http://qs1969.pair.com?node_id=11141227


in reply to Re^2: Extracting selected fields form file record (updated)
in thread Extracting selected fields form file record

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.

Update:

Agree with haukex below to just do it idiomatically without a module: my $string = do { local $/; <$fh> }

See also: Any downsides to this slurp idiom? by haukex (2018 - prior discussion of this problem)