reisinge has asked for the wisdom of the Perl Monks concerning the following question:
Is there a nicer or more idiomatic way to do this? Thanks.use strict; use warnings; my $file = shift; # file to process is the 1st command line argument open my $fh, $file or die; $_ = join '', <$fh>; # make file's content one (big?) line close $fh; s{__END__.*}{}s; print;
Have a nice day, j
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: /s option modifier in regex substitution
by choroba (Cardinal) on Apr 23, 2012 at 09:19 UTC | |
|
Re: /s option modifier in regex substitution
by davido (Cardinal) on Apr 23, 2012 at 09:22 UTC | |
|
Re: /s option modifier in regex substitution
by JavaFan (Canon) on Apr 23, 2012 at 11:15 UTC | |
|
Re: /s option modifier in regex substitution
by 2teez (Vicar) on Apr 23, 2012 at 09:33 UTC | |
|
Re: /s option modifier in regex substitution
by Anonymous Monk on Apr 23, 2012 at 09:31 UTC |