use strict; my @all_data = ; # read all data into the array chomp @all_data; # get rid of the newlines in each element of the array print @all_data; # print the whole array __DATA__ 11111111111 222222222222 333333333 4444444444444