in reply to Re: Form param checking
in thread Form param checking

I'm curious what you mean by
You might want to use CGI.pm as it was intended.

The only difference I see (besides fixing the missing brace) is using the object-oriented style rather than the functional style. Did I miss something?

Replies are listed 'Best First'.
3Re: Form param checking
by jeffa (Bishop) on Dec 30, 2003 at 16:49 UTC

    Well, if the only difference is using the OO style over the functional style, then i say use the functional style. Hands Down. The only time i use the OO style is when i absolutely must ... but until those moments, i use the functional style because it looks cleaner and requires less typing.

    I think neuroball was being a bit subjective by claiming that is how CGI.pm was intended to be used. Especially upon viewing this snippet of unchanged code:

    print "<center><b>Email already exists in database.</b></center>\n";
    which i would have changed to:
    print p({align=>'center'}, b('Email already exists in database'));
    As long as you use param(), header(), and upload(), (correctly) you are using CGI.pm correctly, in my humble opinion. CGI.pm surely subscribes to Perl's philosophy of There Is More Than One Way To Do It!

    I think the outline that Roger provided you with is an excellent place to start studying. You should always write out some kind of design of the possible scenarios ... be it pseudo-code or geometrical shapes with arrows ... before you just start hacking out some code. How can you solve the problem if you don't even understand what the problem is?

    But, do heed Ovid and Podmaster's suggestion to use the CPAN! The idea is that someone has already solved this problem for you, the catch is that you still have to understand what the problem is. That and having a inkling of howto RTFM. ;)

    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)