Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: Problems with using strict

by pfaut (Priest)
on Apr 19, 2003 at 14:31 UTC ( #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 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.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2021-04-14 17:18 GMT
Find Nodes?
    Voting Booth?

    No recent polls found