in reply to Re: Bug in script, regex help req extreme urgent
in thread Bug in script, regex help req extreme urgent
#!/usr/bin/perl -w BEGIN {undef $/;} my $match = "module.*?$ARGV[2].*?([\\(;])"; my $filename = $ARGV[0]; open (INFILE, "<", $filename) or die "Failed to read file $filename +: $! \n"; $string = <INFILE>; close INFILE; $string =~ s/$match/module $ARGV[1]$1/sg; open OUTFILE, ">$ARGV[0]" || die "Failed to create $ARGV[0]\n"; print OUTFILE ($string); close OUTFILE;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Bug in script, regex help req extreme urgent
by pvaldes (Chaplain) on Mar 09, 2013 at 21:53 UTC | |
|
Re^3: Bug in script, regex help req extreme urgent
by jaredor (Priest) on Mar 10, 2013 at 05:13 UTC |