Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Shift versus Sanity (shift is not like assignment from @_)

by grinder (Bishop)
on Apr 24, 2002 at 18:15 UTC ( [id://161708]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
        my( $foo, $bar ) = @_;
    
  2. or download this
        my $foo = shift;
        my $bar = shift;
    
  3. or download this
    sub x {
      $_[0] =~ s/foo/bar/;
      $_[0];
    }
    print x('food'), "\n"; # does not work
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2024-04-24 20:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found