for (@data) { push(@{$arrays}, [split(/ /)]); } #### foreach (@{ $arrays }) { . . . }