my @data = map { chomp; [ split ',' ] } ; Can reformatted as my @data = map { chomp; [ split ',' ] } ;