On 3/16/11 Wed Mar 16, 2011 9:11 AM, "shawn wilson" <[email protected]> scribbled:
> On Mar 16, 2011 11:53 AM, <[email protected]> wrote: >> >> >> if(@ARGV != 1){ >> > > I don't think you can look at an array like its a string like that. > Maybe string( @ARGV ) != 1 might work. But what you probably want is: > If( defined( $ARGV[ 0 ] ) ) Try it! The logical operator != gives scalar context to both left and right operands. An array in scalar context returns the number of elements in the array. Therefore, the expression (@ARGV != 1) will return true if the number of elements in @ARGV is not exactly one. -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] http://learn.perl.org/
