# - handle some pre-processing # $FILE contains a safe path to an existing file on # the filesystem, based on browser input. open( my $fh, '<', $FILE ) or die "open failed: $!"; my $file = do { local $/; <$fh> }; close( $fh ); my ($needed) = $file =~ /\A/s; # now output the document, using the $needed info.