diff options
author | Joe Robinson <joe@lc8n.com> | 2017-07-12 15:21:31 +0100 |
---|---|---|
committer | Joe Robinson <joe@lc8n.com> | 2017-07-12 15:21:31 +0100 |
commit | dcb2720df0a410bdef8714ef983a8d860009c969 (patch) | |
tree | 1a1aecb556d1ffe31d1cbe57209b14127eea6746 /unixtime.pl | |
parent | 955b122dd5ec7560d5b76c6095f024bf9e26560f (diff) |
Handle argument being an empty string in the same way as undefined
Diffstat (limited to 'unixtime.pl')
-rwxr-xr-x | unixtime.pl | 2 |
1 files changed, 1 insertions, 1 deletions
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; |