in reply to /s option modifier in regex substitution

You could use this:

use warnings; use strict; my $file = shift; # file to process is the 1st command line argument open my $fh, $file or die":$!"; while(<$fh>){chomp; last if/__END__/; print $_,$/; } close $fh;