in reply to /s option modifier in regex substitution
Also note that both the solutions incorrectly treat code likeopen my $FH, '<', $file or die $!; while (<$FH>) { last if /^__END__\s/; # Update: maybe /\b__END__\b/ or /(?:^|\s)__ +END__(?:\s|$)/) print; }
print " __END__ ";
|
|---|