On Tue, 12 Dec 1995 08:40:36 MST, Tom Christiansen wrote:
>
>> use warn 3;
>> {
>> no warn qw(W2_UNINIT W2_BARESTR);
>> ...
>> }
>
>that's not very pretty.
Do you mean the notation for the constants? What would
you suggest?
>
>I could certainly write a
>
> use fatal qw/uninit/;
>
>but the __WANR__ hooks aren't nicely stackable, so that
>might be problematic (see diagnostics.pm or CGI::ErrorWrap)
>
&warnhook etc. in the perl source could easily be an ARRAYREF
that would contain a list of cv's. All the cv's could then be
sequentially called. Would this be adequate?:
$SIG{__WARN__} = [\&sub1, 'sub2', sub { '..3..' }];
# ditto for __DIE__
# hmm, __PARSE__ does nothing useful now
On the other hand, I don't see why this can't be implemented
in a warn.pm if we adopt the convention that warn.pm will
provide the interface for stacking and unstacking handlers for
all modules that need to use the __WARN__ facility. Similarly
for die, although I don't like the name die.pm that much :-)
I think we're badly in need of such a convention and interface,
else we'll have modules trampling over each others' handlers.
A module like diagnostics could request special treatment (if no
other module is already getting it) to force itself into
the bottom of the stack so it sees only the warn messages
from perl itself.
- Sarathy.
gsar@engin.umich.edu
>
>> use warn 3;
>> {
>> no warn qw(W2_UNINIT W2_BARESTR);
>> ...
>> }
>
>that's not very pretty.
Do you mean the notation for the constants? What would
you suggest?
>
>I could certainly write a
>
> use fatal qw/uninit/;
>
>but the __WANR__ hooks aren't nicely stackable, so that
>might be problematic (see diagnostics.pm or CGI::ErrorWrap)
>
&warnhook etc. in the perl source could easily be an ARRAYREF
that would contain a list of cv's. All the cv's could then be
sequentially called. Would this be adequate?:
$SIG{__WARN__} = [\&sub1, 'sub2', sub { '..3..' }];
# ditto for __DIE__
# hmm, __PARSE__ does nothing useful now
On the other hand, I don't see why this can't be implemented
in a warn.pm if we adopt the convention that warn.pm will
provide the interface for stacking and unstacking handlers for
all modules that need to use the __WARN__ facility. Similarly
for die, although I don't like the name die.pm that much :-)
I think we're badly in need of such a convention and interface,
else we'll have modules trampling over each others' handlers.
A module like diagnostics could request special treatment (if no
other module is already getting it) to force itself into
the bottom of the stack so it sees only the warn messages
from perl itself.
- Sarathy.
gsar@engin.umich.edu