in reply to Re: [Class Assignment] Regex and Output Files
in thread [Class Assignment] Regex and Output Files
use strict; use warnings; open(my $in, "<", "input.txt") or die "Cannot open < input.txt: $!"; open(my $out, ">", "output.txt") or die "Cannot open < output.txt: $!"; while(my $line = <$in>) { $line =~ s/new/old/i; print $out $line; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: [Class Assignment] Regex and Output Files
by marinersk (Priest) on Feb 20, 2015 at 16:28 UTC | |
by Hayest (Acolyte) on Feb 20, 2015 at 21:36 UTC | |
by marinersk (Priest) on Feb 21, 2015 at 00:00 UTC | |
|
Re^3: [Class Assignment] Regex and Output Files
by toolic (Bishop) on Feb 20, 2015 at 15:47 UTC |