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.
In reply to Re: How to split into paragraphs?
by Samy_rio
in thread How to split into paragraphs?
by jrw
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |