http://www.perlmonks.org?node_id=11124601


in reply to How to Split on specific occurrence of a comma

Hi

instead of limiting split , I'd rather swallow all splitted cells into a long @array and then loop over that @array with splice to chunk out whatever length you want.

here a little demo in the debugger, looping over the alphabet in chunks of 10

DB<208> @array = a..z DB<209> while ( my @b = splice @array, 0, 10 ) { say "@b" } a b c d e f g h i j k l m n o p q r s t u v w x y z DB<210>

HTH! :)

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery