in reply to Split on every second character
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 Section
Seekers of Perl Wisdom