in reply to slurp mode

I don't know if your way is "standard" or not, but I've done it like so on occasion:

my $content = do { local(@ARGV,$/) = $filename; <> };
(when I've just wanted the program to die with an appropriate error when it can't open the file)

Anyway, why go through all the trouble of reading line by line and joining all of the lines together when you can just read the entire file into a scalar without all of the extra processing?