Sorry, I did have difficulty parsing the OP, but for paragraphs I would think that setting $/="\n\n", or something like that, would be more appropriate, no?
| [reply] |
tlm,
Nope. Of course common sense would tell you that "" doesn't imply a paragraph, but reading perlvar it seems Perl made a special case to solve your paragraph slurping problems.
Setting it to "\n\n" means something slightly different than setting to "" , if the file contains consecutive empty lines. Setting to "" will treat two or more consecutive empty lines as a single empty line. Setting to "\n\n" will blindly assume that the next input character belongs to the next paragraph, even if it's a newline. (Mnemonic: / delimits line boundaries when quoting poetry.)
Added snippet from referenced doc
| [reply] |
I believe $/="" is special because it takes one or more blank lines as a record separator.
Wierdly, the only documentation on this feature I can find quickly is in perlfaq6 - perlvar doesn't mention it at all.
update: tested my assumption.
Update2: Limbic~Region is right: it is mentioned in perlvar. For some reason I read past it.
Update3: Also note that the description in perlvar is more accurate than mine, since it explains what happens with the "extra" blank lines (they're thrown away).
| [reply] |
| [reply] |