If you are sure that the string is even sized, you can use a simple regex like this:
Update: modified codeuse strict; use warnings; my $string = "0102030405"; # will miss the last character when string is odd sized my @elements = $string =~ m/(..)/g; print "@elements\n";
In reply to Re: Split on every second character
by linuxer
in thread Split on every second character
by gri6507
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |