Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

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

by Aristotle (Chancellor)
on Mar 01, 2004 at 20:14 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://333038]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-03-29 15:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found