James Edward Gray II wrote:
>
> On Feb 24, 2004, at 8:46 AM, Rafael Garcia-Suarez wrote:
>
> >> But since it's inside an eval() call, those messages should get stuck
> >> in $@ and NOT printed. As Randy has said, they would kill a normal
> >> program, if they were in the source. They are not warnings.
> >
> > Nope. They are warnings, except that they are mandatory ones. You
> > need to write explicitly "no warnings" to disable them. If you do,
> > those messages go in $@ instead.
>
> This is incorrect and easily proved. Please run the following:
>
> #!/usr/bin/perl
>
> use strict;
> use warnings;
>
> my @code = (
> q('a poorly 'nested' string'),
> q('a poorly 'nested::nested' string'),
> );
>
> for (@code) {
> {
> no warnings;
> eval;
> }
> # print "Caught: $@" if $@;
> }
>
> print "\nExiting normally.\n";
>
> __END__
This prints nothing but "Exiting normally" with blead; and
now that you mention it... this was already reported as
a bug (#24815) and was fixed by change #22068.
Change 22068 by [EMAIL PROTECTED] on 2004/01/05 21:48:30
Some mandatory syntax warnings emitted by the lexer weren't
disableable (bug [perl #24815]).
Affected files ...
... //depot/perl/pod/perldiag.pod#366 edit
... //depot/perl/t/lib/warnings/toke#14 edit
... //depot/perl/toke.c#489 edit
> Note that ALL warnings are explicitly disabled and the program is no
> longer printing the error messages yet the strange messages remain.
> Also note that the program does reach the final print.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>