There is nothing undefined about the comparison. The comparison evaluates to false. Perl will usually optimize out the entire statement from the parse tree when this happens to a constant test, as is the case with the "1f" line. What is interesting in this case is that perl leaves a remnant behind in the parse tree/bytecode (as Deparse seemingly indicates), presumably the constant which is being tested. This is consistent with the output of the following code:
| | | #!/usr/bin/perl -w
0;
1;
'0';
|
I believe this warning is a (very minor) bug, since the print+comparison statement should be optimized out of the parse tree entirely.
MeowChow
s aamecha.s a..a\u$&owag.print | [reply] [d/l] |
I am not sure it is a bug.
Does this not fall under the "if it looks like a function..." rule?
Nothing was getting stored anywhere so Perl discarded it.
If you were to change to
my $a = '0';
print "3f\n" if $a;
You don't get output. But you don't get the error. | [reply] [d/l] |