in reply to Why is file being slurped in instead of line by line?
It's because you're undefing $/. That's what the perl runtime uses to determine the line-break character (or string). (Well, technically, line-end string, but let's not get carried away.) Comment out that line, and you'll get what you expect.
If you need it for other things, you should localise your changes - see local. e.g.:
{ # I want to slurp here. local $/; # sluuuuuuuurrrrrp... } # $/ is back to normal here.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Why is file being slurped in instead of line by line?
by Grey Fox (Chaplain) on Aug 26, 2006 at 16:36 UTC |