[% setvar title Change C<$SIG{__WARN__}> and C<$SIG{__DIE__}> to magic subs %]

This file is part of the Perl 6 Archive

Note: these documents may be out of date. Do not use as reference!

To see what is currently happening visit http://www.perl6.org/


Change $SIG{__WARN__} and $SIG{__DIE__} to magic subs


  Maintainer: Simon Cozens <simon@brecon.co.uk>
  Date: 24 Sep 2000
  Mailing List: perl6-language@perl.org
  Number: 284
  Version: 1
  Status: Developing


It sounds really stoopid to say $SIG{__WARN__} on a machine which doesn't have signals.


Perl 6 is going to be portable to all kinds of system, just like Perl 5. Some of those systems won't have signals, so it's time to question why the warn and die hooks are implemented as signal handlers.

Instead, let's implement them as magic subroutines WARN and DIE like BEGIN and END. This seems more consistent anyway. Well, to me.


Call subroutines WARN and DIE instead of the signal handler versions. Everything else stays the same.