Skip Menu |
 

This queue is for tickets about the Time-Elapsed CPAN distribution.

Report information
The Basics
Id: 26908
Status: resolved
Priority: 0/
Queue: Time-Elapsed

People
Owner: burak [...] cpan.org
Requestors: RSAVAGE [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.15
Fixed in: (no value)



Subject: Module fails when time is 0
Download (untitled) / with headers
text/plain 231b
Output: Use of uninitialized value in print at C:\temp\x.pl line 11. 0.15 Program: #!/usr/bin/perl use strict; use warnings; use Time::Elapsed; # ----------- print "$Time::Elapsed::VERSION\n"; print Time::Elapsed::elapsed(0);
From: BURAK [...] cpan.org
Download (untitled) / with headers
text/plain 546b
This was intended and mentioned in the Pod (perhaps it was not clear). Anyway, I've released a new version(0.16) and changed the behaviour. Undefined parameters will return undef and any other false parameter will return "0 second". On Wed May 02 21:30:56 2007, RSAVAGE wrote: Show quoted text
> Output: > Use of uninitialized value in print at C:\temp\x.pl line 11. > 0.15 > > Program: > #!/usr/bin/perl > > use strict; > use warnings; > > use Time::Elapsed; > > # ----------- > > print "$Time::Elapsed::VERSION\n"; > print Time::Elapsed::elapsed(0);
Subject: Re: [rt.cpan.org #26908] Module fails when time is 0
Date: Thu, 03 May 2007 22:32:11 +0000
To: bug-Time-Elapsed [...] rt.cpan.org
From: Ron Savage <ron [...] savage.net.au>
Download (untitled) / with headers
text/plain 938b
Burak Gürsoy via RT wrote: Hi Burak Show quoted text
> This was intended and mentioned in the Pod (perhaps it was not clear).
You're right - there is something in the POD: SECONDS must be a number representing the elapsed seconds. If it is false, 0 (zero) will be used. If it is not defined, undef will be returned. But this does not say undef is /returned/. And I think it's a design fault to return undef for 0, since this messes up the print-out of the program, where 0 is a valid value for the time taken for some task. Returning undef when the input is undef makes sense. Show quoted text
> Anyway, I've released a new version(0.16) and changed the behaviour. > Undefined parameters will return undef and any other false parameter > will return "0 second".
Thanx. But in English that should say '0 seconds', whereas we say '1 second', '2 seconds', etc. It's only 1 that has second after it :-(. -- Ron Savage ron@savage.net.au http://savage.net.au/
Download (untitled) / with headers
text/plain 370b
My bad :) Just released 0.17. False values will now return "zero seconds". Since this is a special case, it can be nice to have "zero seconds" instead of "0 seconds". On Thu May 03 18:39:12 2007, ron@savage.net.au wrote: Show quoted text
> > Thanx. But in English that should say '0 seconds', whereas we say '1 > second', '2 seconds', etc. It's only 1 that has second after it :-(.
Subject: Re: [rt.cpan.org #26908] Module fails when time is 0
Date: Fri, 04 May 2007 11:08:14 +0000
To: bug-Time-Elapsed [...] rt.cpan.org
From: Ron Savage <ron [...] savage.net.au>
Download (untitled) / with headers
text/plain 288b
Burak Gürsoy via RT wrote: Hi Burat Show quoted text
> My bad :) Just released 0.17. False values will now return "zero > seconds". Since this is a special case, it can be nice to have "zero > seconds" instead of "0 seconds".
$many x $thanx; -- Ron Savage ron@savage.net.au http://savage.net.au/


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.