Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

I have a lot of problems w/ my scripts, but this may be the biggie. Please read

by Anonymous Monk
on Jan 07, 2001 at 04:29 UTC ( #50295=perlquestion: print w/ replies, xml ) Need Help??
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I am using perl on the web. I am using mostly the following commands: print if open close and also a small part of code for reading from forms that i got from "Special edition: Using Perl 5 for web programming" by David Harlan and others. Should i be saving these as whatever.pl ir whatever.cgi ?? Oh im using the GET method if that helps....

Comment on I have a lot of problems w/ my scripts, but this may be the biggie. Please read
Re: I have a lot of problems w/ my scripts, but this may be the biggie. Please read
by chromatic (Archbishop) on Jan 07, 2001 at 05:08 UTC
    Choosing the extension of your CGI scripts depends on your web server configuration. Without knowing more about that, it's difficult to assist you.

    Most issues are tangentially related to Perl (but lots of people here do have experience with these sorts of things). The first resource I ever used is this FAQ (don't let the name throw you).

    You will probably want to start your script with:

    #!/usr/bin/perl -wT use strict; use diagnostics; use CGI;
    I have not read your book. If it does not explain strict and CGI.pm, it is probably incomplete and may lead you astray. We can provide you with links to more complete information if this is the case.
($code or die): Re: I have a lot of problems w/ my scripts, but this may be the biggie. Please read
by $code or die (Deacon) on Jan 07, 2001 at 06:28 UTC
    I agree with chromatic's post.

    Check out CGI.pm and also
    Check out Ovid's CGI Course

    Lot's of great info there. I've not read that book either, but I'd use CGI.pm for getting values from web forms, it only takes a couple of lines of code.

    To answer your question though, it usually doesn't matter if you call it *.pl or *.cgi. Try both to see if the script works on your web server, if so then use whatever you're comfortanble with.

    Good Luck
Re: I have a lot of problems w/ my scripts, but this may be the biggie. Please read
by tilly (Archbishop) on Jan 07, 2001 at 10:42 UTC
    I have not heard of that book or that author, which is a really bad sign for its quality. (There are a lot of Perl books out there. Most are written by incompetent people.)

    Even worse signs are the phrases "Perl 5" and "web programming". I usually take both as danger signs of books written more to hit the right buzzwords than to teach anything useful.

    The fact that its name sounds like it might be the same book specifically mentioned by redmist in (redmist) RE: Essential Perl 5 for Web Professionals as a really bad book is an even more ominous sign.

    Your comment that you are using its code for reading forms suggests very strongly that the book rolls its own code for processing CGI. This is sure-fire test that tells you it is complete and utter crap whose only redeeming quality is that you can entertain yourself destroying it. (Please do not succumb to the temptation to recoup your losses by selling it to some other unsuspecting soul who can be damaged by it.)

      This book is available on Amazon (but I don't shop at Amazon). However, I have concerns about it. From the Amazon site:
      From the Publisher
      With a review by Tom Christiansen, one of the original Perl founders, this is one of the most comprehensive books on the market, covering Perl OOP structure, socket programming, HTML conversions, building Internet search utilities, and more! - Focuses heavily on the Windows NT version of Perl
      Offhand, that almost seems reasonable, but I noticed that it didn't explicitly state that Tom Christiansen wrote what's mentioned. I suppose I'm just being cynical.

      Reading through the reviews is not reassuring. They talk about the book being "confusing" and the general opinion seems to be that it's a decent book, but tough to follow. Of course, the reviews for Elizabeth Castro's pitiful excuse for a CGI book are pretty glowing, so I take them with a grain of salt. You can compare them to my dissenting viewpoint.

      The major thing that gives me pause it the mention by one reader that the book was published in 1996. I currently have CGI Programming with Perl (2nd edition), but I also have the first edition of that work. They are very, very far apart in terms of quality. The first edition often ignores many of the things we take for granted: strict, taint checking, CGI.pm, etc. Older books on Internet programming, while they may have been "decent" for their time, are generally to be avoided.

      Of course, who's going to listen to me after my major brain cramp on this post? :)

      Cheers,
      Ovid

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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (11)
As of 2014-07-23 11:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (140 votes), past polls