develooper Front page | perl.perl5.porters | Postings from April 2008

Re: bug or not? constants warn only once

Thread Previous | Thread Next
Vincent Pit
April 24, 2008 10:57
Re: bug or not? constants warn only once
Message ID:

> $ perl -lwe 'sub pie {print 0 + "pie"}; pie; pie;'
> Argument "pie" isn't numeric in addition (+) at -e line 1.
> 0
> 0
> So is this a bug? Advice from Klortho #11943 suggests not:
>   #11943 Ah yes, and you are the first person to have noticed this bug since 1987.  Sure.
> but is it right, or am I?
> Nicholas Clark

While generating a warning at each run is more correct, it doesn't 
really give the user more useful information about the problem. On the 
contrary, correcting this would generate a lot of similar warnings at 
the expense of more checks. I'd be for just letting the things in this 

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About