package ReportGenerator; use strict; use warnings; sub CheckResult { my ( $result, $info ) = @_; #Here is want to check of $result and throw an exception of the kind MyExceptions::RegionNotFound->throw(error => 'bad number'); #I'm not sure how to do this.. } 1;