As usual when a script runs from the command line but not under CGI you have to ask yourself what is different between these two scenarios? A: Permissions. On the command line the script runs as user:you, under CGI it runs with user:nobody and different permissions.
When you say it runs from the command line but not under CGI what do you mean. Browser hangs, no output, wrong output? I have found that CGI::Carp 'fatalsToBrowser' does not catch all errors. As a result I use this in debugging:
BEGIN { $|++; # autoflush buffers; use CGI::Carp 'fatalsToBrowser'; print "Content-type: text/html\n\n"; }
This relaibly gets the errors to the browser and has the added bonus of printing whatever headers your script is sending in plaintext at the top of the window.
cheers
tachyon
s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
In reply to Re: DBI script runs from command line, not from CGI
by tachyon
in thread DBI script runs from command line, not from CGI
by dru145
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |