Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^3: how to deal with incorrect command line argument

by Kenosis (Priest)
on Oct 30, 2013 at 22:37 UTC ( [id://1060466]=note: print w/replies, xml ) Need Help??


in reply to Re^2: how to deal with incorrect command line argument
in thread how to deal with incorrect command line argument

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1060466]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2024-04-25 21:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found