in reply to How to split into paragraphs?
Hi jrw, this may help you if I understood your question correctly.
use strict; use warnings; my $str; while (<DATA>){ chomp; ($_ =~ m/^\w/) ? ($str .= "<\/p>\n<p>$_\n") :($str.="$_\n"); } $str =~ s/^(<\/p>)(.+)$/$2$1/gsi; print $str; __DATA__ abc: asdf1 asdf2 def: asdf3 ghi: asdf4 asdf5
Regards,
Velusamy R.
eval"print uc\"\\c$_\""for split'','j)@,/6%@0%2,`e@3!-9v2)/@|6%,53!-9@2~j';
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: How to split into paragraphs?
by jrw (Monk) on Nov 16, 2006 at 12:22 UTC | |
by Samy_rio (Vicar) on Nov 16, 2006 at 13:03 UTC |
In Section
Seekers of Perl Wisdom