Noone even mentioned File::Slurp! :)
If you must use a module for this, may I suggest Path::Tiny or File::Slurper? See File::Slurp is broken and wrong by Leon Timmermans for why.
... though I agree with haukex below that it's better to do it idiomatically without a module: my $string = do { local $/; <$fh> }
File Slurping References
References Added Later
In reply to Re^3: Extracting selected fields form file record (don't use File::Slurp References)
by eyepopslikeamosquito
in thread Extracting selected fields form file record
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |