http://qs321.pair.com?node_id=1033665


in reply to How to catch SQL::Parser errors in Perl

Either you catch errors with block eval {} or you locally manipulate the %SIG handlers.

(click Search to see older threads=)

See documentation in perlvar: %SIG and eval BLOCK

Cheers Rolf

( addicted to the Perl Programming Language)

Replies are listed 'Best First'.
Re^2: How to catch SQL::Parser errors in Perl
by som.nitk (Novice) on May 15, 2013 at 11:44 UTC
    Tried this but it still shows the Defaut msgs from Parser.pm : Incomplete SET clause! at ./post_fjs_audit.pl line 173
    +173 my $result = eval { $parser->parse($statement) }; +174 unless($result) { +175 print "Caught!\n"; +177 }
    Incomplete SET clause! at ./post_fjs_audit.pl line 173 Caught!
    Any way to suppress these default msgs from Parser.pm ? One more problem is that the program exits on the caught exception. What if there are statements below to process. I dont want the program to exit.