Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: use CGI or die;

by epoptai (Curate)
on Jan 14, 2001 at 12:38 UTC ( #51717=note: print w/replies, xml ) Need Help??


in reply to Re: use CGI or die;
in thread use CGI or die;

I always use strict, -w and fatalsToBrowser when developing, but today this caused me a huge headache in a simple script (with no syntax errors) that merely reads a file, formats the contents, and displays the html.

It runs fine from the command line (with a few uninitialized value warnings) and could save the output with

perl foo.pl > foo.html
but it would just whirl and give no output via CGI. I found that the code looks and behaves perfectly via CGI unless both -w and fatalsToBrowser are enabled! Shut either one off (leaving the other on) and it works fine.

I found a certain loop in the program that seems to cause this by throwing pairs of =cut around, but the loop seems mundane and similar to the others.

Is this odd interplay between -w and fatalsToBrowser documented?

Update: I said i'd node the entire script to craft in a day or two but am finding it difficult to abstract a simplified example. So i'll just suggest that if your error-free cgi script mysteriously hangs, turning off either -w or fatalsToBrowser may help.

dws - Try this for a good html ™:

™

Replies are listed 'Best First'.
Re: (epoptai) Re: use CGI or die;
by dws (Chancellor) on Jan 14, 2001 at 13:20 UTC
    Show us the code!

    Enquiring Monks Want to Know™

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://51717]
help
Chatterbox?
[erix]: heh, understatement of the week :)
[erix]: well, I hope you're right
[Your Mother]: Bill Clinton assaulted and raped repeatedly. Even when it was hinted and finally all but proved, no one cared because his sexism, and racism, and killing was decorous.
[Your Mother]: I think Trump might be better specifically because no one respects him so he won't get his way the way the others did.
[Your Mother]: (I certainly did not vote for him and have been an outspoken critic of his for three decades, by the by.)
[erix]: I'd like Russia threatened a bit more, flattered a bit less
[Your Mother]: The last two regimes killed a million, displaced 10 million, torture prisons, and ruined countries… somehow it's magically bad _now_.
[erix]: what/who are the last two regimes?
[Your Mother]: Bush/Obama. 15 straight years of warfare, torture, etc, etc.
[Your Mother]: All caused by the political fallout of Carter/Reagan when the Afghan chickens came home to roost on 9/11.

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2017-01-20 01:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (173 votes). Check out past polls.