$data = join "", @data, @$random_data; # remove \n they can be re-inserted later # Add this to print all data print join("\n", @$random_data);