Dan Muey wrote: > if you do use strict; and a -w switch and you use $ARGV[0] > it says "use of uninitiated value at line ..." if $ARGV[n] is empty > > What do I need to do with @ARGV or $ARGV[n] to make it not give that message? > > > #!/usr/bin/perl -w > use strict; > > if($ARGV[0] =~ /\d/) { print "$ARGV[0] has a number in it\n"; } # line 4
Remember shortcut evaluation: if($ARGV[0] and $ARGV[0] =~ /\d/) { print "$ARGV[0] has a number in it\n"; } # line 4 Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]