in reply to using $ARGV without arguments

You could set it to a blank string if not defined like this
#!/usr/bin/perl use warnings; use strict; $ARGV[0] ||= ''; if ($ARGV[0] eq 'TEST') { print "$ARGV[0]\n"; }
or check for it being defined like this
#!/usr/bin/perl use warnings; use strict; if (defined($ARGV[0]) && $ARGV[0] eq 'TEST') { print "$ARGV[0]\n"; }
I prefer the second option.