in reply to How to split into paragraphs?

My personal favourite, least complex way is reading from an "in-memory" file.
$_ = q| abc: asdf1 asdf2 def: asdf3 ghi: asdf4 asdf5 |; local $/ = ""; # or $/ = "\n\n"; open IN, '<', \$_ or warn "opening \$_ failed"; my $n; $n .= $_ for <IN>; print "exact" if $n eq $_;
If I wasnt too particular about the double-newlines, I would use split instead.

Replies are listed 'Best First'.
Re^2: How to split into paragraphs?
by jrw (Monk) on Nov 28, 2006 at 01:45 UTC
    Unfortunately, my code has to be compatible with older versions of perl which don't support this, but I agree that it's cool!