in reply to how to splice an array?
Anyway, here's a simple solution with regexps. It allows a trailing element that's too short. (If you don't want that, drop the "1," from the quantification.)
my $str = "PERLPERLPEBLPEBLPERL"; my @parts = $str =~ /.{1,4}/g;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: how to splice an array?
by heidi (Sexton) on Oct 11, 2006 at 16:31 UTC | |
by bobf (Monsignor) on Oct 12, 2006 at 03:45 UTC |