Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: Making a code shorter
by Aristotle (Chancellor) on Jun 26, 2002 at 17:21 UTC
    use CGI::Carp 'fatalsToBrowser'; # <-- recommended

    No it isn't. (Get rid of fatalsToBrowser. It is helpful in development, but has no business in live, client-facing code.)

    Use Template Toolkit or HTML::Template and separate the HTML out of your code. That will shorten the code by about 90% and make it much more maintainable also.

    Other than that, I only skimmed over it, so my feeling that there's a whole lot to clean up may or may not be justified.

    Makeshifts last the longest.

Re: Making a code shorter
by earthboundmisfit (Chaplain) on Jun 26, 2002 at 17:28 UTC
    Since you imported the standard CGI package, there is no need to create the OO cgi object:
    $q = new CGI;
    Removing all those $q->'s might cut it down a bit too.
Re: Making a code shorter
by DamnDirtyApe (Curate) on Jun 26, 2002 at 18:58 UTC