in reply to read file into scalar

You can change the special $/ variable to enable 'slurp mode'.
open PAGE, '<', $success or die "Can't open $success : $!"; flock (PAGE, 1) or die "Can't lock $success for reading: $!"; local $/; my $page = <PAGE>; close PAGE;