while (<>) { # replace italics and bold s{^([ib])\s+(.*)}[<$1>$2]; # find ordered lists if (my $hit= /^\[\s*$/ .. /^\]\s*$/) { if ($hit==1) { print "
    \n"; next; } if ($hit=~ /e0/i) { print "
\n"; next; } s[^][
  • ]; s[$][
  • ]; } }