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.
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
The "good enough" maybe good enough for the now, and perfection maybe unobtainable, but that should not preclude us from striving for perfection, when time, circumstance or desire allow.
|
---|
In Section
Seekers of Perl Wisdom