sub CheckResult { my ($result,$information) = @_; #Now, I need something like this .. If( $result->isa(‘MyException’)) { #Some code to create the report } }