in reply to Re: Re: slurping into scalars
in thread slurping into scalars

Is it possible to alter this so every new-line is printed to a new-line?? for some reason this merges all lines together.
$_ = join("\n", <FILE>);
Adds a second \n to every line. This may be what you are looking for. Seems a bit odd though.

I have done this kind of thing (with some differences) when doing quick and dirty text->html output. Say you want to put <p> tags when you have blank lines but otherwise leave the text untouched then the folowing code works:

do {local $/ = $/.$/;print join('<p>', <FILE>);};

Dingus


Enter any 47-digit prime number to continue.