in reply to using $ARGV without arguments
or check for it being defined like this#!/usr/bin/perl use warnings; use strict; $ARGV[0] ||= ''; if ($ARGV[0] eq 'TEST') { print "$ARGV[0]\n"; }
I prefer the second option.#!/usr/bin/perl use warnings; use strict; if (defined($ARGV[0]) && $ARGV[0] eq 'TEST') { print "$ARGV[0]\n"; }
|
|---|