Toady Tim. Is map() a function, technically?
#! /usr/bin/perl -lw my @a = split //, shift; print "INPUT = <@a>"; # @a[0..$#a] = @a[map -1-$_, 0..$#a]; @a[$_,~$_] = @a[~$_,$_] for 0..$#a/2; print "OUTPUT = <@a>";
In reply to Re: reverse a string in place
by Anonymous Monk
in thread reverse a string in place
by Priti24
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |