Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

A newbie's thoughts on CGI, and Learning a Lesson

by stuffy (Monk)
on May 27, 2001 at 11:01 UTC ( [id://83580]=perlmeditation: print w/replies, xml ) Need Help??

Before I came to Perl Monks, and before I knew about CGI.pm, I would go to various different places to find CGI scripts for my website. I thought that CGI Resource was a good place to get pre-made scripts. Now I know better. I got curious, I started downloading some of the scripts and read through them. Not very many use CGI.pm. I find that odd, considering the complexity of some of the scripts, the authors seem to know alot about perl, yet they don't know the benifits of CGI.pm (I'm still learning, but at least I know to use it (thanks ovid)) I found a site that shows how to make a simple cgi form. I used that form in a script, had some problems and got flamed pretty hard about that. I found other scripts on that site that the author is allowing for others to download and and use, but knowing what I know now, I will not use them. In fact, when I get around to updating my site, I will remove these links because I don't want someone else making the same mistakes I have made...My backside is still a little tender from the beating I got by not using CGI.pm on this site :~) Thanks to merlyn I now know that there is no excuse for not using it, and after I took the time to read the many pages of documentation associated with it, it is actually easier to use. What I can't understand is how do these people slip through the cracks. I mean, these seem like some pretty good perl coders, but they never heard about (or think they can do better then) CGI.pm. Is there a monk here that has been around a while that would thing of not usning CGI.pm? I think not! Would I ever post saying that I'm not using CGI.pm? Not on your life!
I realize that there are probably alot of wannabe hackers like myself that go out and find tutorials written by someone like this that will fall into the same trap that I fell into, or alot of amature web designers like myself that find the 2200 + perl scripts on the cgi resource site to be exactly what they are looking for, but are leaving themselves wide open for problems. It makes me wish that there was a way to protect the unknowing (such as myself) from such a fate. Maybe we can start a mass e-mail campaign sending out links to ovid's tutorial on CGI.pm, especially the page about why we should use it. Then if we find that anyone that we sent an e-mail to is still not using it, we go to there home and torture their family, dog, roomate, whatever they have. Ok, so that won't work, but it is an idea. ;~)

Update:

fixed link to ovid's tut.

Stuffy

That's my story, and I'm sticking to it, unless I'm wrong in which case I will probably change it:~)
  • Comment on A newbie's thoughts on CGI, and Learning a Lesson

Replies are listed 'Best First'.
(Ovid) Re: A newbie's thoughts on CGI, and Learning a Lesson
by Ovid (Cardinal) on May 27, 2001 at 21:01 UTC

    Thank you for your kind words regarding my (unfinished) CGI course.

    stuffy: I'm sorry that my previous response to you came across as a flame. Unfortunately, seeing people use poorly-written alternatives to CGI is very common on this site and my reaction to it is getting to be a bit knee-jerk.

    Incidentally, another resource to help learn why not to use alternatives is chromatic's home node1 and use CGI or die;, which has some interesting responses to it.

    Cheers,
    Ovid

    1. Of course, chromatic's home node is subject to change without warning :)

    Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.

Re: A newbie's thoughts on CGI, and Learning a Lesson
by mrmick (Curate) on May 27, 2001 at 17:28 UTC
    I think that some would probably not use CGI.pm because of their perception of run-time overhead. Overall, 'use CGI;' is wonderful and recommended practice when generating html-type content.

    I could see that some would not use it (justifiably) for a very simple page or if it means rewriting what had been developed before CGI.pm became popular.

    Mick
Re: A newbie's thoughts on CGI, and Learning a Lesson
by sierrathedog04 (Hermit) on May 28, 2001 at 04:30 UTC
    Same thing here. I inherited some fairly decent Perl scripts to maintain at work, and the authors were always parsing their own CGI form values instead of using CGI.pm's param(). And it was causing problems if someone posted a form value with a space in it.

    Learning that I should always use CGI.pm is the most important lesson that this site has taught me. Before I posted here I did not know it existed.

Re: A newbie's thoughts on CGI, and Learning a Lesson
by damian1301 (Curate) on May 28, 2001 at 07:14 UTC
    Just to point out that maybe the reason that none of the people on those "Free Perl scripts" sites don't use it is because of portability. Some servers may not have CGI.pm so as long as the authors do it "their way" and not the right way, it will work as far as the eye can see, but with multiple errors when really put to the test.

    I know that there are multiple ways to include CGI.pm in a script but not many that a newbie/new user would want to do.

    Tiptoeing up to a Perl hacker.
    Dave AKA damian

      Sorry, but that's not a convincing reason. Please read No excuses about not using CGI.pm. CGI.pm has been a standard part of Perl since version 5.004_04. If you're using a version older than that then you need to either change your sysadmin or your ISP.

      --
      <http://www.dave.org.uk>

      "Perl makes the fun jobs fun
      and the boring jobs bearable" - me

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://83580]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2024-04-19 13:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found