On 10 Aug 2000 22:26:47 -0000, Chaim Frenkel <[EMAIL PROTECTED]> wrote:

> =head2 Encodings
> 
> I have listed some possiblities. But none of these are ideal.
> 
> =head3 A unique number
> =item As an integer
> =item As a floating point number
> =head3 Unique String
> =head3 Prefixes for all error strings (Shades of Big Blue)

Well, $@ could also contain a structured  'error object' allowing
not only stringification, for

        if( $@ =~ /such-and-such-error/ ) {}

situations, but also (somewhat à la VMS):

$@->facility   # CORE, module name, whatever
$@->severity   # fatal, informational, error, debug...
$@->message    # 'file %s not found' (== stringify)
$@->data       # an optional hash for additional data

Obviously, to be useful a standard classification of severity levels
(akin to the one in diagnostics) should be used, and it'd be better
if there were some hooks for modules to register unique facility
names; OTOH, perhaps not: the module name *is* it's own unique
identifier :)

                                                           /L/e/k/t/u

Reply via email to