Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
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?
[Tux]: ELISHIVA, erix, Discipulus, afoken DBD::CSV now pushed. Try wget https://github. com/perl5-dbi/DBD- CSV/archive/ a26beac1.tar.gz -O DBD-CSV-0.50_01- a26beac1.tgz

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (10)
As of 2017-05-29 06:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?