From dcb2720df0a410bdef8714ef983a8d860009c969 Mon Sep 17 00:00:00 2001 From: Joe Robinson Date: Wed, 12 Jul 2017 15:21:31 +0100 Subject: Handle argument being an empty string in the same way as undefined --- unixtime.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'unixtime.pl') diff --git a/unixtime.pl b/unixtime.pl index f47cf9f..ca99311 100755 --- a/unixtime.pl +++ b/unixtime.pl @@ -2,7 +2,7 @@ use POSIX qw( strftime ); use Time::HiRes qw( gettimeofday ); -if (defined $ARGV[0]) { +if (defined $ARGV[0] and $ARGV ne "") { if ($ARGV[1] eq "ms") { #Convert from timestamp in milliseconds to date $seconds = substr $ARGV[0], 0, 10; -- cgit v1.2.3