I've a six character string I'd like to split into three character pairs. I just keep thinking it should be easier to split the string in pairs, than my solution. The closest I can get is this:
$var1 = $1 and $var2 = $2 and $var3 = $3 if /(.{2})(.{2})(.{2})/;
Can anyone think of a more elegant and perly way to do this? Just curious.
In reply to split fixed string into character pairs by raybies
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |