Given -
#!/usr/bin/perl -w
# use strict; # use diagnostics; # use warnings;
my @strings = ( q(my $bad_syntax = ;), q('a poorly 'nested' string'), q('a poorly 'nested::test' string') );
foreach (@strings) { # no warnings; eval; }
print "\n\nProgram exited normally...";
Results:
Bareword found where operator expected at (eval 3) line 1, near "'a poorly 'nested::test"
(Missing operator before nested::test?)
String found where operator expected at (eval 3) line 1, near "nested::test' string'"
Program exited normally...
Reasoning:
Each 'eval' (of the three only two are invalid)
All three strings are invalid Perl code. Try including them in your next script, if you don't believe that. ;)
are the only portion of the script which is dying - and rightly so - but this "death" doesnt propagate to the main logic.
So, my question now is -- Why is this a bug?
Two reasons, in my opinion. One, those are die() messages, but the program doesn't die(). It doesn't die() because they are coming from inside an eval() call. Which leads us to two, eval() doesn't print die() messages or die() (it's getting one out of two right, at least). It's supposed to stick die() messages in $@ and return undef.
James
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>