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

Re: shift vs @_

by Anonymous Monk
on Oct 03, 2006 at 08:27 UTC ( #576013=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
        sub my_map {
            my $special_thingy = shift;
    ...
                apply($special_thingy, $item);
            }
        }
    
  2. or download this
        my ($special_thingy, @list_of_items) = @_;
    
  3. or download this
        sub my_map {
            foreach my $item (@_[1 ..$#_]) {
                apply($_[0], $item);
            }
        }
    
  4. or download this
        sub my_map {
            for (my $i = 1; $i < @_; $i++) {
                apply($_[0], $_[$i]);
            }
        }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (11)
As of 2014-08-22 14:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (158 votes), past polls