in reply to Handling A File In Human-Compatible Chunks
Setting local $/ = ''; # paragraph mode will cause each use of <FH> or readline to return a 'paragraph' of text from the file, where a paragraph is defined as block of text delimited by 1 or more blank lines.
Paragraph mode is described breifly (and rather confusingly) in perlvar under the description for the $INPUT_RECORD_SEPARATOR.
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.
|
|---|