The other responses in this thread are addressing your problem directly, but I wanted to point out an alternative.
In general, fixed-length string decomposition is easiest with unpack (and if necessary, its companion pack). Your particular example can be accomplished with:
Golf anyone? :-)my $newstring = join '' => reverse unpack('a4 a4', $string);
In reply to Re: rearranging a string.new
by VSarkiss
in thread rearranging a string.new
by drock
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |