jpk236 has asked for the wisdom of the Perl Monks concerning the following question:

Hello fellow monks,

I have a script which parses a series of XML files. Some the files have shown to have XML syntax issues, or even be blank all together.

Is there a way to capture the error output of XMLin() -- from XML::Simple -- to provide better error messages or to even completely kill the script if a certain case were to appear.

Thanks!

- Justin

Replies are listed 'Best First'.
Re: Capture XMLin errors
by marto (Cardinal) on Jul 18, 2008 at 12:15 UTC
      ::stamps "RTFM" on forehead::

      Thanks everyone!
Re: Capture XMLin errors
by pjotrik (Friar) on Jul 18, 2008 at 12:17 UTC
    just use block eval and $@ as anywhere else where you need to catch exceptions