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

Re: Check to See if there is Values in Getopt::Long

by ikegami (Patriarch)
on Aug 02, 2011 at 21:58 UTC ( [id://918142]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @opts = qw( a b ... z );
    GetOptions(
    ...
    for my $opt (@opts) {
       die("...\n") if !exists($opts{$opt});
    }
    
  2. or download this
    my %opt_defs = (
        ( map { $_ => "$_=s" } qw( a b ... ) ),
    ...
    for my $opt (keys(%opt_defs)) {
       die("...\n") if !exists($opts{$opt});
    }
    

Log In?
Username:
Password:

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

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

    No recent polls found