my $data = 'a(b)cd(e)f'; my @chunks = $data =~ /.{5}/g; print "@chunks";
Change the value in the regex for a different number of chars.
In reply to Re: Split a string into items of constant length
by inman
in thread Split a string into items of constant length
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |