in reply to Extracting a hash reference from a string
then $@ would contain the hash reference. Since it seems to also include the text, I assume that you are throwing the error in a different way, stringifying the hash reference as you go along.my %exception = (err => 42, str => 'My fault'); die \%exception;
A better way to do this (if you want the error object to still work as a normal error message when not used as a hash ref) is to return a proper blessed object. That way you can use the overload.pm module to provide custom stringification, and also have access to your exception record.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Extracting a hash reference from a string
by Anonymous Monk on Mar 23, 2003 at 02:42 UTC | |
by jand (Friar) on Mar 23, 2003 at 03:35 UTC |