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. ;)
|