Click to See Complete Forum and Search --> : Can someone


Jona
01-26-2003, 08:08 PM
Please point me in the right direction to learning Perl/CGI? I want to learn it, but I don't quite understand a lot of things about it... Please point me in the right direction, someone! Thank you!

jeffmott
01-26-2003, 09:22 PM
http://www.perldoc.com/

Jona
01-26-2003, 09:30 PM
Cool! Another thing, you have as your signature a Perl code. I understand that it is using a Split() method, right?

Could you explain to me the basics of Perl/CGI? I mean, you know how the basic HTML is <HTML><HEAD><TITLE>youTitle</TITLE>.. etc., well, can you explain that in Perl instead of HTML? Thanks a lot, man.

jeffmott
01-26-2003, 10:50 PM
There really is no such template you need to create a valid Perl program. Though three things that you should have in all your Perl/CGI programs is strict, warnings, and taint mode. You'll see this reinforced throughout perldoc as well. You should also use the CGI module when available, unless you have done extensive research on one of its functionalities and wish to replace it with one of your own.

#!/usr/bin/perl -wT
use strict;

use CGI;

Jona
01-27-2003, 04:41 PM
OK, about that #!usr/bin/perl -wT

I understand the -wT is an automatically executed function?

Also, would I use #!usr/bin/perl if my domain was, "rocky.com"? And my CGI bin was, "rocky.com/cgi-bin/"?

Would I have to change that to, "#!rock.com/cgi-bin/"?

jeffmott
01-27-2003, 07:01 PM
I understand the -wT is an automatically executed function?
Sort of. They are command line flags to change compiler directives (makes perl issue warnings it otherwise won't tell you about).

Would I have to change that to, "#!rock.com/cgi-bin/"?
It is the path to the Perl interpreter on your server and is unrelated to your domain name. /usr/bin/perl is the most common but your server may still be different. You'll have to check your server's documentation.

Jona
01-27-2003, 07:26 PM
OK, cool, thanks. You're a great help! That site really is a blessing to me. Thanks.

Charles
01-27-2003, 07:47 PM
Perl is profoundly cool. It's not a pretty as JavaScript, but it's really cool. Allow me to suggest a couple of things. Got to your public library and borrow Sam's Teach Yourself PERL in 21 Days (http://search.barnesandnoble.com/booksearch/isbnInquiry.asp?userid=2VO2Q5J54L&isbn=0672320355&itm=1) and if you use the Linux, Solaris or Windows then play around with ActivePerl from ActiveState (http://www.activestate.com/Products/ActivePerl/).

Among Perl die-hards it has become a sport to get scripts to as few lines as possible and to make those lines as un-readable as possible. (They even have a yearly contest for the longest and most unreadable line of real code.) It's not only fun, but it makes for better running scripts.

And know that Perl is just a collection of neat little tricks. If you ever think that there has to be a better way then be assured, there is.

jeffmott
01-27-2003, 11:02 PM
Charles
Got to your public library and borrow Sam's Teach Yourself PERL in 21 Days
Though I have not looked through Sam's Teach Yourself PERL in 21 Days I personally find the need for a book unecessary in Perl. Perldoc is for Perl as the HTML Spec is for HTML. There is no better reference. And for the topics that are a little heavy, separate tutorials have been written and posted at perldoc.

Though if you still feel you need a book, on the left side of perldoc.com is a link for "Learn Perl" that contains a list of the best books available. A few are authored by Larry Wall (the inventor of Perl), and others by people who help in its continued development.

Charles
01-28-2003, 05:49 AM
Originally posted by jeffmott
I personally find the need for a book unecessary in Perl. Perldoc is for Perl as the HTML Spec is for HTML. There is no better reference. And for the topics that are a little heavy, separate tutorials have been written and posted at perldoc.I also am at that stage, now. But it took a simple, yet comprehensive book to get me here. Once I had a grasp of just what tools were there in the tool box and a basic understanding of how each was used then I could use the real documentation and begin the work of really learning the language.

Nedals
01-28-2003, 07:01 PM
Jona:
If you understand the basics of programming then pick up..

O'Reilly's Perl 5 pocket reference.

It's a great once you understand the principles.

One extra item to add (see jeffmott's post) at the beginning of any Perl program...

use CGI::Carp qw(fatalsToBrowser);

It will send syntax errors, etc. to your browser

Jona
01-28-2003, 10:28 PM
I'd like to say thanks a lot, guys.

I (finally) got a JavaScript book for Christmas, and I was so excited! Actually, yesterday I picked up a Visual BASIC book that I found. It was on version 6.0. Well, within a day, I have almost finished creating my own text editor like Notepad! I was amazed at how simple it was. I mean, at that rate, I can master Visual Basic (and VBScript, since it's almost the same thing) within a month! Of course, I've been so busy lately with JavaScript, Perl, memorizing the Book of John (NIV in the Bible), and stuff like that, it may be awhile before I get back around to it.. anyways, what y'all said was a great help, and I look forward to more support in the future. Notice: I said, "look forward to" not, "expect."

Thanks a lot,

Jona
01-29-2003, 02:17 PM
By the way, my library doesn't have a thing! They don't even have books on the Hexadecimal system.

Mr Cgi Guy
01-30-2003, 06:10 PM
I suggest getting the book "Perl and CGI for the World Wide Web" by Elizabeth Castro. It's about $20 from borders or similiar stores. It's a great overview of Perl and it's uses on the internet. It's really the best way to get your feet wet.

The oreilly books are great if you have an understand of programming already. But if you're completely new to it all, you'll just be wasting your money.

In my opinion those 'teach your self Perl in xx days' books are junk. Personally, I only use Perl for internet development, and those books generally have about 1 chapter of Perl for the www.

Jona
01-30-2003, 10:57 PM
My internet experience and programming level is way above average. I've learned everything I know within a year... that is, JavaScript (mostly, I'm not quite a "master" yet), HTML, CSS, and I've looked at a lot of Perl and CGI scripts. I've even used a lot, and read some documentation. I am an experienced programmer, and I'm very good at what I do. Anyways, I know what Perl is, I just needed a push in the right direction. Jeffmott has given me www.perldoc.com. Which is, in my opinion, an amazingly useful site. I intend to use it to its fullest extent.