Author: John W. KrahnJohn W. Krahn Date: May 12, 2008 11:31
Tatiana Lloret Iglesias wrote:
> Hi all!
Hello,
> i'm running the following dummy program which just opens a file and I get an
> error (die message)
>
> #!/usr/bin/perl
>
>
> if ( @ARGV[0] eq '' )
@ARGV[0] is an array slice (a list) and it makes no sense to compare a
list to a string. It looks like you want something like this:
if ( @ARGV != 1 ) # must have 1 argument
Where you compare an array in scalar context which returns the number of
elements in that array.
|