View Full Version : I'm Really Having Probs With This Perl/CGI Stuff
eclypto
12-30-2003, 08:05 PM
Normally these things aren't hard for me. However, I think I've become so HTML oriented that nothing else wants to make sense.
I'm trying hard to understand this stuff, but I've gone through a few tutorials and without success (mainly because my computer will respond with NO program).
So I guess what my question is, is could someone PLEASE explain this to me in depth. The following script is meant for a messageboard. I need to know what to change to make it acceptable enough to make a message board out of it.
#!/usr/bin/perl
use CGI qw(:standard :form);
use strict;
my $cgi = new CGI;
print $cgi->header(-type=>'text/html');
print "Hello\n";
__END__
My website is www.eclypto.com, I have all of the necessary cgi, php, whatever! I just don't have the knowledge to do anything with it yet!!! Thanks people.
P.S.
Do I need to put script tags around it too???
Jeff Mott
12-31-2003, 03:20 PM
could someone PLEASE explain this to me in depthDid the links I gave you in your last post not do that? A message board is not a job that can be completed in 5 minutes. There's nothing that could be said on these boards that wouldn't be wholly inadequate.The following script is meant for a messageboardThat is a skeleton script, I'm assuming given to you merely as an example of a simple Perl script. It is nowhere close to being a message board.I just don't have the knowledge to do anything with it yet!!!The references I linked to are probably the best you're going to find on the Web. If they do not help you then you may want to consider taking a class at some nearby college.
jujuraf
01-11-2004, 04:55 AM
You can't expect to write code as complex as is needed to create a forum when you haven't learned the very basics of Perl. You should start with very simple programs like display the current time/date, or adding up a set of numbers from a web form, etc. Since you know HTML, create a form with some fields for the user to enter numbers in it. On submit, have your Perl script read the data from the form and display a web page with the answer (using whatever math you want, it doesn't matter). This exercise will get you thinking about how the form data gets to the Perl script, how the Perl script reads the form data and out to create a web page on the server that gets sent to the user (on the client computer).
If Perl is totally new to you, then don't start with CGI right away. Start with the book "Learning Perl" from O'Reilly Press as it's a classic for beginners. You can use Perl w/o having anything to do with web pages as it's great for general purpose string manipulation, etc.
If you know Perl basics but need to know how to use it to create dynamic web pages, that's where CGI.pm comes into play. I highly recommend "Official Guide to Programming with CGI.pm" by Lincoln Stein (who invented CGI.pm). It starts out very simple with your Hello program and progresses to complex HTML creation code. It's not a big book but very well written.
Both of these books are what I read to learn Perl and CGI. My copies are very well worn from so much use. There's no substitute for digging in and read and trying the examples. It really works! No one in this forum learned any programming methodology w/o doing their own homework. It takes time and patience and lots of practice. :thumbsup:
Deb
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.