Free Republic
Browse · Search
General/Chat
Topics · Post Article

To: Ernest_at_the_Beach
Perl code looks more like:


sub get_reply {
    my $reply = {};

    $reply->{text} = $Focus::r->cgi->param('reply');
    if ($reply->{text} =~ m#<\w+(?:.|\n)*>#i) {  # MAGIC
        $reply->{text} = html_filter($reply->{text});
    }
    else {
        $reply->{text} = html_format($reply->{text});
    }

    my $l = new Focus::UserLookup;

    $l->lookup($Focus::r->cgi->param('name'));

    $reply->{rcpt_string} = $l->lookup_string;
    $reply->{rcpt_list}   = $l->lookup_list;

    if ($reply->{text} !~ /\S/) {
        push @{$reply->{errors}}, "Enter a reply.";
    }

    push @{$reply->{errors}}, map { $_->{text} } $l->errors if $l->errors;

    $reply;
}
Scared ya, didn't I?
17 posted on 06/19/2002 5:28:21 PM PDT by John Robinson
[ Post Reply | Private Reply | To 14 | View Replies ]


To: John Robinson
Yes, you done good there.

Doesn't look like COBOL or FORTRAN!

19 posted on 06/19/2002 5:32:29 PM PDT by Ernest_at_the_Beach
[ Post Reply | Private Reply | To 17 | View Replies ]

To: John Robinson
Scared ya, didn't I?

No. You write clean looking code.

28 posted on 06/19/2002 10:47:59 PM PDT by altair
[ Post Reply | Private Reply | To 17 | View Replies ]

Free Republic
Browse · Search
General/Chat
Topics · Post Article


FreeRepublic, LLC, PO BOX 9771, FRESNO, CA 93794
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson