in reply to put file content into a string

You could also use the "-0777" command line switch if you were writing a quick solution to do something like parsing the entire input file as a single line in order to alter the newlines that otherwise require a range operator to deal with, ie:
perl -0777 -pe 's/\n+/\n/g' myFile
The value 0777 will cause Perl to slurp files whole because there is no legal byte with that value.