@stuff = split m{ }x => $data; #### while( $data =~ m{ \G ( .+? ) }xg ){ my $number = $1; my $data = $2; #... }