At 10:45 AM -0500 5/17/01, webkat wrote:
>I am brand new in trying to learn perl. I have downloaded MacPerl. I am
>currently doing an online class trying to learn perl basics. The problem
>I'm having is that the information I create doesn't seem to be working for
>me. The examples used in this online course are *supposed* to work. I have
>used bbedit to create text files to put into my cgi-bin. I have also used
>MacPerl & "save as" cgi script. I have double-checked my shebang line &
>verified it to be correct with the ISP. I have double checked permissions
>after I FTP. I am at a loss.
>
>The first script I uploaded, which wasn't working at the time I uploaded
>it...I sent an email to support at my hosting site. The guy said he put it
>through pico & that it worked fine. Now I'm confused. Since I know that it
>worked for him when he put it through pico...am I supposed to do that each
>time too? I was assuming that I could use macperl (or bbedit?) to write
>perl code & upload it to my cgi-bin & it should work. My hosting site
>*supposedly* doesn't support troubleshooting for perl (even though they
>helped last time). I'm just wondering if anyone has any ideas of what I'm
>doing wrong...or what I'm overlooking. I'm getting quite frustrated when I
>get server errors when I'm trying out a script. <sigh>
>
>Any help would be very much appreciated!
To start, *do not* save your scripts as MacPerl CGIs; leave them as
text files. The only exception to this would be if your ISP's server
is a Mac, which is unlikely. Upload your scripts as text, not binary.
Your ftp client will handle conversion of Mac line endings to
whatever's right for the server's OS.
Just make this one change, and then test again.
If you want to simulate CGI execution with MacPerl on your own local
Mac, search the MacPerl webcgi list archives, and read David
Steffen's article in Issue 11 of PerlMonth,
<http://www.perlmonth.com/index.html?issue=11>.
In the bigger picture, your learning process will be far more
coherent and much less frustrating if you invest the time now in
mastering ways of capturing Perl's error messages and warnings. In a
web/CGI context, it's possible to dump out Perl's messages in HTML,
and to record them to your own log file. That way, whatever happens,
you'll see exactly where and why your script fails, not just get a
server error message telling you to contact the system admin. If the
tutorial you're following doesn't cover this, get more help.
1;