in reply to Re: no error messages for syntax errors?
in thread no error messages for syntax errors?
I don't think that's it because if I remove the syntax errors so that the code works again, and then call
print STDERR "hello world.\n";
It prints exactly as expected. If stderr were redirected, then I wouldn't see that.
Besides, that shouldn't matter: if my code is redirecting STDERR, and there are syntax errors that causes the perl interpreter to terminate execution, that should write to my terminal regardless of where my code's perception of STDERR is, right? If not, you could really screw yourself up.
However, you raise an intereseting point: a possible source of confusion could be the CARP package, which has a BEGIN block and redirects STDERR for debugging cgi scripts (where there is no terminal to output to). I do include a module that has that, but as I said, this was never a problem before. Nothing's changed, unless there has been a reordering of use lines that include packages. Does order matter for stuff like that? Since I have this problem now, but didn't before, that might answer my own question. It might have been that the CARP package from some module was being masked.
I'll pre-empt someone's potential answer that might say, "don't do that" with a question: Can a module do that? (ie., a module use CARP to redirect stderr) Is it better/more appropriate/"blessed" to never have modules do that, and instead keep those in the main package?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: no error messages for syntax errors?
by BrowserUk (Patriarch) on Dec 06, 2004 at 03:34 UTC | |
by argv (Pilgrim) on Dec 06, 2004 at 04:11 UTC |