in reply to How do I read an entire file into a string?
open FILE, "myfile" or die "Couldn't open file: $!"; while (<FILE>){ $string .= $_; } close FILE;
Originally posted as a Categorized Answer.