Debugging Perl

Pardon the slight rant surrounding this question: <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /><br /><br />Is there any way to get more useful error messages out of my perl scripts. It seems that if there's anything wrong at all, I get "Premature end of headers" in the log file.<br /><br />I've got the permissions set right (755)...<br /><br />There are various problems I've found with scripts by fumbling around, but I got no help from error messages.<br /><br />I didn't realize how much I'd miss the shell access I had with my previous host. When I had a shell, I could run the script on the command line to see what came out. Without that, I have only the error messages to go by. One useful thing would be, a way (presumably within cpanel) that I could run a script and redirect the output to a file I can download and read. <br /><br />Thanks for your help,<br />Malcolm<!--content-->
I've found that many of the jobs I used to do with shell, can be done with cron jobs. I've used those a whole lot more than I ever anticipated!<br /><br />If you're doing heavy duty testing of scripts you write yourself, maybe you should set up your own Linux box at home. If you've got an old computer somewhere (even an old P1 100 MHz box will do, and even older if it's got a decent size hard drive), you can set it up and use for testing.<!--content-->
I'll assume you are using some sort of Windows machine. You could always get a copy of Perl to run on your computer for testing purposes.<br /><br />One site that comes to mind is <!--coloro:blue--><span style="color:blue"><!--/coloro-->www.activeware.com<!--colorc--></span><!--/colorc--><!--content-->
When you create a new Perl script in Cpanel, the "blank" script contains these lines:<br /><br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->#!/usr/bin/perl<br />use CGI::Carp qw(fatalsToBrowser);<!--c2--></div><!--ec2--><br /><br />That second line will dramatically improve your life. It's like having shell access, except the output is nicely formatted HTML. From the day of discovery, I haven't left that line out of a single script I've created.<br /><br />-David<!--content-->
 
Back
Top