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