http://qs1969.pair.com?node_id=900294

Perllace has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks, This is my perl problem I have a script something like
$object1 = $ABC->Find('test1'); #Then I want to call a subroutine called CheckResult in #Report.pm Report->CheckResult($object,”Finding the value”); #In another case I want to report if a particular command #was execute +d, so I do something like this.. Report->CheckResult($ABC->Command(100,100),”Performing the command”);
Now in Report.pm #Report.pm
sub CheckResult { my ($result,$information) = @_; #Now, I need something like this .. If( $result->isa(‘MyException’)) { #Some code to create the report } }
How do I use exception class and how to check if an exception is raised,and if so perform the task necessary..?? Thanks, Perllace