in reply to CGI::Carp Doesnt seem to work properly

CGI::Carp is not a substitute for perl -c (or whatever the equivalent is for Win32).

[that would be perl -c ... thanks Enlil ;) ]

It is intended for redirecting warnings and run-time errors, but not syntax errors [ UPDATE - this is simply wrong ... CGI::Carp is intended to handle syntax/compile time errors. Looks like this may be a bug introduced in version 1.24. See below ]
use strict; use warnings; use CGI::Carp qw(fatalsToBrowser warningsToBrowser); warningsToBrowser(1); if(my $foo == 'bar') { die "yes"; }
You could wrap the code in question in an eval block, but it's easier to test the syntax on a command line.

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

Replies are listed 'Best First'.
Re: (jeffa) Re: CGI::Carp Doesnt seem to work properly
by theAcolyte (Pilgrim) on May 22, 2003 at 08:31 UTC

    Jeffa; While I dislike disagreeing, I've seen syntax errors in my browser window with CGI::Carp before - I'm 99.9% sure. That .1% of doubt comes from your comments. However, the documentation POD for CGI::Carp states:

    "Fatal errors will now be echoed to the browser as well as to the log. CGI::Carp arranges to send a minimal HTTP header to the browser so that even errors that occur in the early compile phase will be seen. Nonfatal errors will still be directed to the log file only (unless redirected with carpout). "

    So that would imply compile time (syntax) errors will show up from CGI::Carp.

    = Erik