in reply to Some advice on another's scripts

I think you did a conscious thing by pointing the guy to the wrongs he has done. For the most part, I wouldn't bother doing the same thing if I were in your shoes. So, I would command your courage and selflessness.

In addition to the points of improvement you've suggested, I'd also go as far as saying to use a templating system instead of simply writing HTML inside your script. There's a lot of wonderful tools out there. samtregar's HTML::Template is one of them.

I would like to also respectfully disagree with your "use CGI.pm to it's fullest" statement, though. Just how do you go and measure that? In most of my scripts, I use CGI to retrieve parameters sent to the script, process cookies, file uploads and so forth. However, I don't particularly favor CGI's html producing features. Certainly, this probably stems from the fact that I'm big on templates. ;-).

_____________________
# Under Construction

Replies are listed 'Best First'.
Re: Re: Some advice on another's scripts
by Kickstart (Pilgrim) on Jun 25, 2002 at 18:56 UTC
    I'd really love to see a "Perl Style and Security Coding Guide" (hopefully with a better name) that covered all of these things. For myself, I have written a lot of garbage scripts that exist out there on the net right now without -w, use strict, taint, etc. I didn't know better when I was starting to lean Perl because there were no resources (especially no single resource) that covered these. The books I learned from never even touched on tainting, or if they did no "Why this is important" info was given. Kickstart
      I'd have to agree with Kickstarts's comment 100%. I too have coded several Perl scripts that get the job done, but not necessarily in the best way. After having hung out on PM.org, I've picked up things like -w and use strict, but I feel there is much more to learn before my code is to be considered "well written". I learned Perl from several different books and am still continuing along the path of Perl wisdom. It would be great to have a tutorial on proper Perl style, security issues, modules etc. I know I'd reference it at least once a day! Monks?
      Ovid's excellent CGI course is much of what you ask for; I try to plug it at every opportunity.

      Makeshifts last the longest.

        (wow, I am such a geek)...

        I would like to take this on vacation with me to give it the attention it deserves. Required reading, absolutely. :)

        Now...off to find a leech script to get the whole thing onto my laptop!

        Kickstart