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

Re: shift vs @_

by shmem (Canon)
on Oct 02, 2006 at 19:33 UTC ( #575932=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
        # 1. non-destructive
        my $var = $_[0];                      # first element of @_
    ...
        # 2. destructive
        my $var = shift;                      # first element gets removed
    + from @_
        my ($foo, $bar) = map { shift } 1,2;  # two elements get removed f
    +rom @_
    
  2. or download this
    sub foo {
        my $foo = $_[0];
        my $quux = baz(@_)
        return $foo ^= $quux;
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2014-04-18 06:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (462 votes), past polls