in reply to Re: Perl 5.6.1 Regular Expression problems (UTF8 ?)
in thread Perl 5.6.1 Regular Expression problems (UTF8 ?)

perl -wle 'BEGIN { $SIG{__DIE__} = sub { print "Catched SIGDIE: @_";ex +it(-1) }} use utf8; /^\w$/;'

Results in:
Catched SIGDIE: Can't locate object method "IsWord" via package "main" + (perhaps you forgot to load "main"?) at /usr/local/lib/perl5/5.6.1/u +tf8_heavy.pl line 30.

This code illustrates the problem: the eval() done by utf8_heavy.pl fails and calls the die-handler which is set within the BEGIN block. I think this should not happen, because the 'die' within eval() is in a different scope than the position where the Die-handler is set.

Replies are listed 'Best First'.
Re: Bug Isolated was: Re: Re: Perl 5.6.1 Regular Expression problems (UTF8 ?)
by premchai21 (Curate) on Sep 29, 2001 at 08:50 UTC
    Actually, according to the documentation, this is correct behavior. Die handlers carry over into evals.