|Think about Loose Coupling|
Re: Method referencesby Neighbour (Friar)
|on Jun 18, 2012 at 10:24 UTC||Need Help??|
A standard way to catch errors is to use die (or Carp), in combination with eval. But since I prefer Try::Tiny, I'm going to use that.
This results in:
ERROR: Something went wrong in methodA at ./monks24.pl line 12. (monks24.pl being the name of the executable).
This is because errorA is checked before errorB.
If you'd set errorA to 0 (meaning all is well in methodA), you'd get this:
ERROR: Something went wrong in methodB at ./monks24.pl line 20.