in reply to read file into scalar
I often to this:
my $text = do { local( @ARGV, $/ ) = ( $file ); <> }; [download]
although it's not as robust as the other solutions which die on error.