in reply to Re: PM Poster (util for ease of posting / reply)
in thread PM Poster (util for ease of posting / reply)

Alright. I have to admit at this point that you were absolutely right about not posting!

That being said, I like writing in "natural text" and I'll work on a rewrite that will do something to convert that to paragraphs instead of breaks.

"For fate which has ordained that there shall be no friendship among the evil has also ordained that there shall ever be friendship among the good." - Plato / Socrates

  • Comment on Re: Re: PM Poster (util for ease of posting / reply)

Replies are listed 'Best First'.
(jeffa) 3Re: PM Poster (util for ease of posting / reply)
by jeffa (Bishop) on Jul 13, 2003 at 15:00 UTC
    This is by no means perfect, but it's a step up from your original code.
    #!/usr/bin/perl -T use strict; use warnings; use CGI qw(:standard); print header, start_html('PM Poster'), start_form, textarea('post',undef,8,30), submit('go'), end_form, ; if (param('go')) { for (split /\s*\n(?:\s*\n)(?!.*\n*<\/code>)+/, param('post')) { $_ =~ s/<(\/?)code>/<$1tt><$1pre>/g; print p($_),"\n"; } } print end_html; __END__ lines of source: 29 (including __END__ block) empty lines: 5 commenting (shebang to be considered code): 6 lines containing only "}" or ";": 3 lines of code: 10 (first print is really only 1 line)

    jeffa

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    B--B--B--B--B--B--B--B--
    H---H---H---H---H---H---
    (the triplet paradiddle with high-hat)