Skip Menu |

This queue is for tickets about the Params-Util CPAN distribution.

Report information
The Basics
Id: 50005
Status: rejected
Priority: 0/
Queue: Params-Util

People
Owner: Nobody in particular
Requestors: BLILBURNE [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: _POSINT returns undef for integers with leading 0
001 is a valid positive integer which perl will treat correctly, i.e, 001 + 002 = 3 _POSINT returns undef for string scalars with leading 0 characters, even if they are positive integers.
From: paul [...] liekut.de
On Thu Sep 24 21:37:53 2009, BLILBURNE wrote: Show quoted text
> 001 is a valid positive integer which perl will treat correctly, i.e, > > 001 + 002 = 3 > > _POSINT returns undef for string scalars with leading 0 characters, even > if they are positive integers.
It seems that this is the desired behaviour (see the tests in t/12_main.t). _NONNEGINT also returns undef for string scalars with leading 0 characters and it looks like it is intended that this should be the case. I'm guessing that you probably should use _NUMBER for what you are wanting to do as this explicitly allows string scalars with leading 0 chars. Given this information would you consider this ticket to be resolved? Cheers, Paul
On Wed May 28 17:54:31 2014, paul@liekut.de wrote: Show quoted text
> On Thu Sep 24 21:37:53 2009, BLILBURNE wrote:
> > 001 is a valid positive integer which perl will treat correctly, i.e, > > > > 001 + 002 = 3 > > > > _POSINT returns undef for string scalars with leading 0 characters, > > even > > if they are positive integers.
> > It seems that this is the desired behaviour (see the tests in > t/12_main.t). _NONNEGINT also returns undef for string scalars with > leading 0 characters and it looks like it is intended that this should > be the case. I'm guessing that you probably should use _NUMBER for > what you are wanting to do as this explicitly allows string scalars > with leading 0 chars. > > Given this information would you consider this ticket to be resolved? > > Cheers, > > Paul
I agree, Paul :) But I like to reject for the records. Jens
Fully agree to Paul's analysis.