in reply to Comparing $_ --- before/after
Instead of slurping the file into a scalar, read it to an array, and then do the substitutions one line at a time, printing as you go if you succeed at substituting on the line. I'm loath to attempt to code it since I should have been in bed quite a while ago, but in general if you want line-by-line action and control on a file, you shouldn't put it in a scalar.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Comparing $_ --- before/after
by mrc (Sexton) on Oct 10, 2009 at 08:53 UTC | |
by zwon (Abbot) on Oct 10, 2009 at 10:37 UTC | |
by mrc (Sexton) on Oct 10, 2009 at 11:15 UTC | |
by mrc (Sexton) on Oct 10, 2009 at 10:48 UTC | |
by zwon (Abbot) on Oct 10, 2009 at 11:06 UTC |