Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re^4: Benifits of using hash rather than number of variables?

by duelafn (Vicar)
on Jul 21, 2011 at 14:33 UTC ( #915883=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download

  1. or download this
    sub whatever {
        my %params = @_;
    whatever key2 => $value2;
    whatever keyq => $value1; # Hash has key 'keyq' which is not in the ne
    +w key set
  2. or download this
    use Getopt::Long qw/:config bundling/;
    use Hash::Util qw/ lock_keys /;
    my @OPT_SPEC = qw/ help|h version noact|no-act|dry-run DEBUG output|o=
    +s /;
    GetOptions \%OPT, @OPT_SPEC or ($OPT{help} = 1);
    lock_keys(%OPT, map /^(\w+)/, @OPT_SPEC);
  3. or download this
    # Option 1: use Params::Validate
        lock_keys %params, keys %expected_params;
        # ...

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://915883]
[jedikaiti]: Yea, the kids (& the cats) are good at that
talexb is having a hard time with Windows losing DNS info for Perlmonks when voting. CB works fine. Ugh.
[jedikaiti]: how odd

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (13)
As of 2017-07-25 15:17 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (374 votes). Check out past polls.