in reply to read file into scalar

Anonymous Monk,
That is because in scalar context, the angle bracket operator (see also readline) uses $/ (see perlvar) to return a single line. To get it to read the entire file, simply undef it (locally of course).
my $page; { local $/; open(my $fh, '<', $file) or die $!; $page = <$fh>; }

Cheers - L~R