in reply to Re^3: Trapping XML error using Perl
in thread Trapping XML error using Perl

You're forgetting eval {}
#!/usr/bin/perl -- use strict; use warnings; use XML::Parser; my $p1 = new XML::Parser(Style => 'Debug'); eval { $p1->parse('error NOW> <foo id="me">Hello World</foo>'); }; warn "CAUGHTS ANS ERRORS BOSSS: $@\n" if $@; undef $p1; __END__ CAUGHTS ANS ERRORS BOSSS: syntax error at line 1, column 0, byte 0 at ...