Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Problems with using strict

by pfaut (Priest)
on Apr 19, 2003 at 14:31 UTC ( [id://251660]=note: print w/replies, xml ) Need Help??


in reply to Problems with using strict

I'm guessing you didn't include any error messages in your post because this is a CGI script and you don't know how to find them. Here's some tips for debugging CGI errors.

  • Use perl -c <filename> after any changes. This tells perl to load up your script and parse it but not execute it ('use' statements and BEGIN blocks will be executed). If there are any syntax errors in your script, they should be found here. Since you're getting an error when trying to use strict, this should tell you more about the problem.
  • Execute the code from the shell. This is real easy if your script doesn't accept form input or look at web server provided environment variables but even if it does that's easy enough to provide. Any expected environment variables can be set to appropriate values before executing the script. Form variables can be provided on the command line as field=value pairs (you are using CGI.pm to parse your form input, right?).
  • If you get past these steps and still have problems executing your code from a browser, look for your web server's error log file. Any output to your application's STDERR should be written to that file. As an alternative, add the following to the top of your script to have your own error log:
    BEGIN { open STDERR,">>my_script_errors.log" or die "Unable to open errorlog"; }

    Make sure that whatever account your web server uses to execute scripts has write access to the file and directory you specify.

90% of every Perl application is already written.
dragonchild

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://251660]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-24 01:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found