in reply to Re^3: Using Perl Exception Class
in thread Using Perl Exception Class
As of now, I have a module of the kind
The other module ispackage MyExceptions; use strict; use warnings; use Exception::Class ( 'MyExceptions', 'MyExceptions::RegionNotFound' => { isa => 'MyExceptions' }, 'MyExceptions::CommandNotExecuted' => { isa => 'MyExceptions' } );
The user would inturn script something like this $Report->CheckResult($ABC->Command(100,100),"Tapping Home");package ReportGenerator; use strict; use warnings; sub CheckResult { my ( $result, $info ) = @_; #Here is want to check of $result and throw an exception of the kin +d MyExceptions::RegionNotFound->throw(error => 'bad number'); #I'm not sure how to do this.. } 1;
Thanks for your help..
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Using Perl Exception Class
by Corion (Patriarch) on Apr 20, 2011 at 11:29 UTC |