in reply to remove line break from 1 line
I'm pretty sure chomp only works on a single line...
I'm definitely sure that reading the entire file into a single variable isn't waht you want (particularly if you want to chomp). I would read it line by line and while(<$in>) { chomp } if I were you.
But if you must slurp the entire file into a var (which is fine when the files are small), then I would probably choose something like $entire_file =~ s/[\r\n]//sg.
-Paul
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: remove line break from 1 line
by chargrill (Parson) on Jan 20, 2007 at 06:11 UTC |