=head
Hello,
I have been trying to not die when calling perldoc,
but the code below keeps dying inside perldoc.
The code below does show that eval is happening
at runtime, and that the syntax used for shutting
off __DIE__ does work when perldoc is not involved.
So how can one avoid dying inside perldoc?
=cut
use diagnostics;
use warnings;
use strict;
use Pod::Perldoc;
$| = 1;
my @lookup=();
my $foo = 'Pod::Perldoc->run(\'args\', [EMAIL PROTECTED])';
my $boo;
# works as expected -- since it does NOT die inside eval
my ($answer, $a, $b);
$a=1; $b=0;
eval { local $SIG{'__DIE__'}; $answer = $a / $b; };
print "after eval:$@,,,\n";
# works as expected -- correct output
@lookup=qw(-q require);
print "before eval\n";
eval { local $SIG{'__DIE__'}; $boo = eval $foo;};
print "after eval:$@,,,\n";
# works as expected again -- correct output
@lookup=qw(-q require);
print "before eval\n";
eval { local $SIG{'__DIE__'}; $boo = eval $foo;};
print "after eval:$@,,,\n";
# DIES inside eval -- WHY????
@lookup=qw(fooey);
print "before eval\n";
eval { local $SIG{'__DIE__'}; $boo = eval $foo;};
print "after eval:$@,,,\n";
# never executed -- dies before getting here
@lookup=qw(-q require);
print "before eval\n";
eval { local $SIG{'__DIE__'}; $boo = eval $foo;};
print "after eval:$@,,,\n";
__END__
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs