sub LIMIT () { 100 } my @chunk; while( my $chunk = substr( $initial, 0, LIMIT, '') ) { push @chunks, $chunk; }