in reply to /s option modifier in regex substitution

Is there a nicer or more idiomatic way to do this? Thanks.

No , its as straight forward as it gets

You could write  __END__[.\n]* or the results of  qr/.s/ (which are for perl 5.12  __END__(?s-xim:.)* and for perl 5.14  __END__(?^s:.)* ) but they're still hairy regexes