#!/usr/bin/perl use strict; use warnings; # get current epoch time my $epoch_time = time; # check if an epoch time is passed on command line $epoch_time = $ARGV[0] if defined($ARGV[0]); print "epoch: $epoch_time\n"; my $lt = localtime($epoch_time); print "text: $lt\n";