Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: interchanging variables the tough way

by gnat (Beadle)
on Aug 30, 2000 at 21:55 UTC ( [id://30358]=note: print w/replies, xml ) Need Help??


in reply to interchanging variables the tough way

sub invert { return @_ unless @_>1; ($_[0],$_[-1]) = ($_[-1],$_[0]); invert(@_[1..$#_-1]); } @l = (10..20); print "@l becomes "; invert @l; print "@l\n";

Log In?
Username:
Password:

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

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

    No recent polls found