Perl Monk, Perl Meditation | |
PerlMonks |
Re: Using split() to divide a string by lengthby chibiryuu (Beadle) |
on Apr 13, 2006 at 20:10 UTC ( [id://543211]=note: print w/replies, xml ) | Need Help?? |
This doesn't use split, but is the first thing I think of:
Hmm, $string =~ /.{1,3}/g should even be faster than split /(?(?{pos() % 3})(?!))/, $string. I guess not as fast as unpack, though.
In Section
Meditations
|
|