Hmm, $string =~ /.{1,3}/g should even be faster than split /(?(?{pos() % 3})(?!))/, $string. I guess not as fast as unpack, though.my $string = join '', 'a'..'z'; my @fields = $string =~ /.{1,3}/g; my @fields2 = grep {$a=!$a} @fields;
In reply to Re: Using split() to divide a string by length
by chibiryuu
in thread Using split() to divide a string by length
by japhy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |