On Fri, Apr 25, 2008 at 09:06:39AM +0200, H.Merijn Brand wrote: > On Thu, 24 Apr 2008 18:39:35 +0100, Nicholas Clark <nick@ccl4.org> > wrote: > > > On Thu, Apr 24, 2008 at 07:23:50PM +0200, H.Merijn Brand wrote: > > > > > > The implementation caches the numeric result, and uses that next time round, > > > > before it gets a chance to warn. It's been this way since (at least) 5.005_03 > > > > (which is the oldest perl I have hanging around) > > > > > > > > So is this a bug? Advice from Klortho #11943 suggests not: > > > > > > Not a bug. I recall relying on this behaviour somewhere to speed up > > > loops. When you add 0 to a string value, it fills the IV/NV, so inside > > > the loop it doesn't have to convert. > > > > Oh, I didn't mean that the caching was a bug. No, caching is key. > > I meant that not warning felt buggy. > > Then I wasn't verbose enough too, as I think it should warn once and > only once. Maybe until either value changes. I agree. Repeating warnings is bad, IMO. It is a warning after all; if converting a non-numerical string to a number is deemed to be so dangerous a repeat warning is in order, a fatal error would be better. AbigailThread Previous | Thread Next