in reply to /s option modifier in regex substitution
perl -lni.bak -e '/^__END__$/ && last; print;' filename.pl [download]
Dave