laziness, impatience, and hubris | |
PerlMonks |
Re^3: how to deal with incorrect command line argumentby Kenosis (Priest) |
on Oct 30, 2013 at 22:37 UTC ( [id://1060466]=note: print w/replies, xml ) | Need Help?? |
You're most welcome! Am glad it helped. You're commenting is correct. You asked, "why use $_ here?" Because Perls default scalar ($_) is implicitly used in the for loop that's iterating through the elements of @ARGV. Note, also, that Perl's default scalar is also implicitly used in the expression if (-e) { as that expression is equivalent to if (-e $_) {. The purpose of next is to get the next element of @ARGV, otherwise a warn would occur.
In Section
Seekers of Perl Wisdom
|
|