JPH wrote:
I think the below answers my question.
Yes. About that. Please do not top-post. TIA.
I thought maybe the code was
doing some perl magic, but it is probably just a leftover from something
else.
Also I wasn't aware of the || construction to use for setting default
values when ARGV (in this case) is undefined.
ARGV in which case? The filehandle ARGV wasn't used in the original
program or Brandon's reply below (although it should be above) so I
can't see how you know whether if was defined or not. (And I don't
think that you can test a bareword filehandle for definedness? You
certainly can't test an array or hash for definedness.)
And the || operator doesn't test whether a variable is defined or not,
it just tests whether a variable is true or false. The // operator
however will test that its left-hand operand is defined or not.
Thnx all!
On 11/24/2011 09:05 PM, Brandon McCaig wrote:
So the code
the OP posted isn't doing anything useful there. It's effectively
just redundantly copying the values out of @ARGV.
John
--
Any intelligent fool can make things bigger and
more complex... It takes a touch of genius -
and a lot of courage to move in the opposite
direction. -- Albert Einstein
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/