Gossamer Forum
Home : General : Perl Programming :

Learning Question?

Quote Reply
Learning Question?
Hello,

I want to learn PERL or CGI programming so that I can make software for the web. Like mailing lists, shopping carts, etc.

Do I need to learn PERL or CGI programming? I picked up some books on Perl called:

"Learning Perl"
"Perl, In A Nutshell"
"Programming Perl"
"Perl Cookbook"

by O'reilly publishers.

Am I heading in the right direction or should I be using different books to learn.

Thanks in advance.



------------------
James L. Murray
VirtueTech, Inc.
www.virtuetech.com
Quote Reply
Re: Learning Question? In reply to
Learning Perl is the first step. (As Alex has quoted in these forums.) It is the foundation.

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: Learning Question? In reply to
Hello,

I also am not running on a UNIX based system. I have a UNIX account with a hosting company that I pass my scripts over to with FTP.

Can I learn PERL well by this method?

Thanks in advance, again.

------------------
James L. Murray
VirtueTech, Inc.
www.virtuetech.com
Quote Reply
Re: Learning Question? In reply to
Yes...(If your ISP has Perl installed.)
You can FTP files to your server and change permissions of files via most FTP programs, including AceFTP, QFTP, etc.

I would contact your ISP to see if they allow custom Perl and CGI scripts to run on their server. Also ask them about FTP programs that you can use that will allow you to change permissions of files and directories.

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: Learning Question? In reply to
Hello Eliot,

Thanks for all your help.

The reason why I asked the baove question was becuase I tried to create a simple script that one of my books "Learning Perl" asked me to create. The "Hello World" script.

The script is as follows:

Code:
#!/usr/bin/perl

print "Hello, World!\n";

This script is very simple, however it didn't run on my web browser. I had to enter

Code:
print "Content-type: text/html\n\n";

for it to run properly on the web browser.

I'm explaining all of this becuase I don't want to run into anymore snags and learn the language improperly if there is a way to avoid it. Do you think that:

Code:
print "Content-type: text/html\n\n";

will be the only line I have to continuously add to every script in the book?

Thanks in advance.



------------------
James L. Murray
VirtueTech, Inc.
www.virtuetech.com
Quote Reply
Re: Learning Question? In reply to
From what I can tell you need to identify the correct Perl Path (#!/usr/bin/perl). Contact your ISP and ask them the questions I gave you earlier. Also ask them the correct path to the Perl program they have installed on the server. I would also recommend surveying your ISP's web site for answers.

The correct script should look like the following:

Code:
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "Hello World!";

But again, you need to check the Perl Path.

Also you may need to change the permission of the file to 755 or -rwxr-xr-x.

Translation:

Owner: Read, Write, Execute
Group: Read, Execute
Everyone: Read, Execute

Also, I forgot to mention that most perl scripts and cgi scripts run under the /cgi-bin/ directory. If you do not have one, then you will have to request one to be made from your ISP or get another ISP that offers access to /cgi-bin/.

BTW: I am a bit confused. Both of your web sites seem to be running cgi scripts. Are you a staff person wanting to know about Perl???

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us

[This message has been edited by Eliot (edited July 08, 1999).]

[This message has been edited by Eliot (edited July 08, 1999).]
Quote Reply
Re: Learning Question? In reply to
If you are on a windows system, download perl for windows:

http://www.activestate.com

and then you can try all your demos through the command prompt and worry about the headaches of CGI and permissions/content-type once you get past Hello World. =)

Cheers,

Alex
Quote Reply
Re: Learning Question? In reply to
Thats it. Thank you Alex and Eliot.

Activestate will be perfect.

Smile

------------------
James L. Murray
VirtueTech, Inc.
www.virtuetech.com
Quote Reply
Re: Learning Question? In reply to
Alex,

Exactly...

Is that Perl for WIN32?

------------------
James L. Murray
VirtueTech, Inc.
www.virtuetech.com
Quote Reply
Re: Learning Question? In reply to
Yes...It is Perl for Win32 that Alex talked about.

Regards,