sub invert { return @_ unless @_>1; ($_[0],$_[-1]) = ($_[-1],$_[0]); invert(@_[1..$#_-1]); } @l = (10..20); print "@l becomes "; invert @l; print "@l\n";
In reply to Re: interchanging variables the tough way
by gnat
in thread interchanging variables the tough way
by ANKUR
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |