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

Re: Getopt - Validate arguments before processing

by davies (Prior)
on Jan 30, 2022 at 16:10 UTC ( [id://11140966]=note: print w/replies, xml ) Need Help??


in reply to Getopt - Validate arguments before processing

One of my all-time favourite nodes, The Dynamic Duo --or-- Holy Getopt::Long, Pod::UsageMan!, shows how to do this with Getopt::Long, which is core. The line that does the job appears in the text and the full example, and is:

pod2usage(-verbose => 1) && exit if ($opt_debug !~ /^[01]$/);

Regards,

John Davies

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2024-04-19 06:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found