in reply to How to modify a file
Of course. Perl can do anything :)
# Add this somewhere before the loop # open output file my $outfile = "some_filename.ext"; open my $out, '>', $outfile or die "can't open $outfile: $!\n";
then change say $text; to say $out $text;. Look out!, there is no comma, between the output file handle and the data you want to send to it.
Cheers,
R.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to modify a file
by static0verdrive (Initiate) on Apr 25, 2013 at 13:58 UTC | |
|
Re^2: How to modify a file
by biancoari (Initiate) on Apr 25, 2013 at 17:05 UTC | |
by poj (Abbot) on Apr 25, 2013 at 18:06 UTC |