while (<$file>) { push (@data, "$_\n"); } print @data; #### $data = do { local $/; $_ };