> "Tim" == Tim Johnson <[EMAIL PROTECTED]> writes:
Tim> So you need to change your code to:
Tim> If(@ARGV[0] eq "-q"){
Tim>print "It worked\n";
Tim> }else{
Tim>print "It did not work\n";
Tim> }
And you really need to change @ARGV[0] to $ARGV[0], or else
the "don't use an array slice
On Thursday, September 4, 2003, at 04:31 PM, Thomas Browner wrote:
Can some one tell me way this does not work.
I believe I can, yes. :)
if (@ARGV[0] = "-q"){print "it worked\n";}
else {print "it did not work\n";}
Okay, one issue at a time. First @ARGV[0] should be $ARGV[0]. When
we're talki
>The "==" operator checks two numeric values for comparison, returning true
>if they match
>The "eq" operator checks two string values for comparison, returning true
>if
>they match
oh dear!! i'd forgotten that detail.
sometimes i still get myself with this one.
willy
--
To unsubscribe, e-mai
>
>Can some one tell me way this does not work.
>
>
>
>if (@ARGV[0] = "-q"){print "it worked\n";}
try (@ARGV[0] == "-q")
^^ this got me too- the "==" compares values
while "=" assignes the right side value to
lef
This is a very common mistake, so don't feel bad.
The "=" operator assigns the value on the right to the variable on the left.
The "==" operator checks two numeric values for comparison, returning true
if they match
The "eq" operator checks two string values for comparison, returning true if
they
try this:
if (@ARGV[0] == "-q"){print "it worked\n";}
else {print "it did not work\n";}
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]