in reply to remove line break from 1 line
Should I be doing this line by line instead of slurp?
Yes, I would do it line by line. For one thing, your chomp statement is only being applied to the single line that you read in, rather than a list of lines.
For another, your regular expression is only being applied once, rather than to all of the lines individually.
But finally, if you want to debug what lines you're reading, and what they look like after any modifications, it's a LOT easier when you read them into an array.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: remove line break from 1 line
by Anonymous Monk on Jan 19, 2007 at 18:58 UTC | |
by liverpole (Monsignor) on Jan 19, 2007 at 19:02 UTC | |
by djbryson (Beadle) on Jan 19, 2007 at 19:23 UTC | |
by djbryson (Beadle) on Jan 19, 2007 at 19:30 UTC | |
by djbryson (Beadle) on Jan 19, 2007 at 20:02 UTC | |
by graff (Chancellor) on Jan 21, 2007 at 06:37 UTC |