[Omaha.pm] XML::Twig error handling

Jay Hannah jay.hannah at iinteractive.com
Mon Oct 22 12:56:11 PDT 2012


On Oct 22, 2012, at 2:49 PM, Justin Esbenshade <jesbenshade at omnihotels.com> wrote:
> So what happens after all the try's?  Do you still have to say "if ($table)"?

  my ($sql);
  try { $sql =        $s->first_child('sql')->text; };

Ya, $sql is just undef if anything went wrong. So you can if ($sql) if you want. Or you could catch {} and do something...

j





More information about the Omaha-pm mailing list