homepage Welcome to WebmasterWorld Guest from 54.235.39.132
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
Forum Library, Charter, Moderators: coopster & jatar k & phranque

Perl Server Side CGI Scripting Forum

    
Perl Output Code - Internal 500 Debug
Perl Output Code - Internal 500 Debug
DJRyan




msg:435463
 10:36 pm on Aug 21, 2004 (gmt 0)


I have just setup a script but it's not working.

I have tested other .pl files and they work - what I am looking for is a few lines of code I can inject int the .pl that will output some errors to the browser so I can debug the problem.

Thanks in advance!

 

lexipixel




msg:435464
 5:35 am on Aug 22, 2004 (gmt 0)

Since Perl is interpreted at runtime, a 500 "internal server error" means the code would not run...

If you have perl on a local machine you can run the code from a command line and read the errors... sometimes as simple as a missing curly bracket or semi-colon.

Otherwise, see if your host has a "Check Perl Scripts" utility you can use to debug online.

kaled




msg:435465
 8:58 am on Aug 22, 2004 (gmt 0)

Download Active Perl and debug it on your PC/Mac.

Kaled.

tschild




msg:435466
 10:40 am on Aug 30, 2004 (gmt 0)

What you can insert (near the top of the script, with the other use statements) is:


use CGI::Carp qw(fatalsToBrowser);

Lord Majestic




msg:435467
 11:16 am on Aug 30, 2004 (gmt 0)

Just some common reasons (may not be applicable in this case however) why script that appears to run fine in Windows then dies on Unix.

1) make sure you upload script using ASCII transfer mode - if you use binary then Unix system will choke and die on Windows style of end of lines.

2) make sure you have turned buffering off, use this: $¦ = 1;

3) of course you need to output at least some headers! Here is bare minimum:

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

tombola




msg:435468
 7:58 pm on Aug 30, 2004 (gmt 0)

If you are serious about Perl programming, you must follow the advice of kaled and install Perl Active State on your local system. It will save you a lot of time to debug your scripts ;-)

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved