[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Omaha.pm] XML::Twig error handling



On Oct 22, 2012, at 2:49 PM, Justin Esbenshade <jesbenshade@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