my $content; open FILE, '<', $guestbookreal; # Open a filehandle FILE to $guestbookreal while () { chomp; # delete any EOL character(s) $content .= $_; # Add the next line to the previous parts }