in reply to Re: What is the best solution to swap input data?
in thread What is the best solution to swap input data?
my $data = '123456789'; foreach (my $i = 0; $i + 1 < length $data; $i += 2) { substr($data, $i, 2) = reverse substr($data, $i, 2); } print $data, "\n"; __END__ 214365879
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: What is the best solution to swap input data?
by Hofmator (Curate) on Nov 09, 2006 at 15:20 UTC |