Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: The Dynamic Duo --or-- Holy Getopt::Long, Pod::UsageMan!

by klekker (Pilgrim)
on Jan 14, 2007 at 10:20 UTC ( #594626=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    # Check this last to avoid parsing options as Places,
    #   and so don't override $opt_man verbose level
    my @places  = @ARGV;
    pod2usage(-verbose => 1) && exit unless @places;
    
  2. or download this
    GetOptions(
        "help|?" => sub { pod2usage( -verbose => 1, -exitval => 0 ); },
        "man"    => sub { pod2usage( -verbose => 2, -exitval => 0 ); },
    # ...
    ) or pod2usage( -verbose => 1, -exitval => 1);
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://594626]
help
Chatterbox?
[Corion]: Ah no, at least in my feeble experiments that doesn't change the meaning
[Corion]: We sell sanity in small packages ;)
[Eily]: oh, boolean context uses the "" overload if no bool overload has been defined
[Eily]: (I wondered if overloading bool was actually necessary)

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (9)
As of 2017-07-27 13:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (414 votes). Check out past polls.