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

Re: Perl Idioms Explained - my ($foo, $bar) = @{shift(@_)}{qw/ -foo -bar /}

by Aristotle (Chancellor)
on Mar 01, 2004 at 20:14 UTC ( #333038=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub foobar {
        my %arg = @_;
        my ($foo, $bar) = @arg{qw/ -foo -bar /};
        # ..
    }
    
  2. or download this
    my ($foo, $bar, %arg) = @_;
    my ($baz, $quux) = @arg{qw(baz quux)};
    
  3. or download this
    sub moo {
        my $self = shift;
        my ($foo, $bar) = @$self{qw(foo bar)};
        # ..
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (9)
As of 2014-09-16 09:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (158 votes), past polls