Skip Menu |

This queue is for tickets about the DateTime-Calendar-Discordian CPAN distribution.

Report information
The Basics
Id: 112551
Status: rejected
Priority: 0/
Queue: DateTime-Calendar-Discordian

People
Owner: jaldhar [...] braincells.com
Requestors: J2N-FORGET [...] orange.fr
Cc:
AdminCc:

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



Subject: Failure on February 29th
The following code: use DateTime; use DateTime::Calendar::Discordian; my $d0 = DateTime->new(year => 2016, month => 2, day => 29); my $d1 = DateTime::Calendar::Discordian->from_object(object => $d0); print $d1->strftime("Discordian\n%Y-%b-%d, %{%A %d %B%} %Y %N%H\n"); fails with: Use of uninitialized value in hash element at /home/jf/perl5/lib/perl5/DateTime/Calendar/Discordian.pm line 389. Use of uninitialized value in substitution iterator at /home/jf/perl5/lib/perl5/DateTime/Calendar/Discordian.pm line 526. Discordian 3182--St. Tib's Day, St. Tib's Day 3182 What is wrong? Can you fix please?
On Mon Feb 29 01:07:04 2016, JFORGET wrote: Show quoted text
> The following code: > > use DateTime; > use DateTime::Calendar::Discordian; > my $d0 = DateTime->new(year => 2016, month => 2, day => 29); > my $d1 = DateTime::Calendar::Discordian->from_object(object => $d0); > print $d1->strftime("Discordian\n%Y-%b-%d, %{%A %d %B%} %Y %N%H\n"); > > fails with: > > Use of uninitialized value in hash element at > /home/jf/perl5/lib/perl5/DateTime/Calendar/Discordian.pm line 389. > Use of uninitialized value in substitution iterator at > /home/jf/perl5/lib/perl5/DateTime/Calendar/Discordian.pm line 526. > Discordian > 3182--St. Tib's Day, St. Tib's Day 3182 > > What is wrong? Can you fix please?
It is the %b (season abbreviation) specification. St Tib's Day doesn't belong to any season so of course it doesn't have a season abbreviation and so %b = undef. The correct way to deal with it is to enclose it in %{ %} as you already have in the next part of the format string. So I don't really think this is a bug. Or do you think maybe %b (and %B) should return q{} instead of undef in this case?
Subject: Re: [rt.cpan.org #112551] Failure on February 29th
Date: Mon, 29 Feb 2016 21:10:37 +0100
To: bug-DateTime-Calendar-Discordian [...] rt.cpan.org
From: Jean Forget <J2N-FORGET [...] orange.fr>
Le lundi 29 février 2016 à 11:14 -0500, Jaldhar H. Vyas via RT a écrit : Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=112551 > > > On Mon Feb 29 01:07:04 2016, JFORGET wrote:
> > The following code: > > > > use DateTime; > > use DateTime::Calendar::Discordian; > > my $d0 = DateTime->new(year => 2016, month => 2, day => 29); > > my $d1 = DateTime::Calendar::Discordian->from_object(object => $d0); > > print $d1->strftime("Discordian\n%Y-%b-%d, %{%A %d %B%} %Y %N%H\n"); > > > > fails with: > > > > Use of uninitialized value in hash element at > > /home/jf/perl5/lib/perl5/DateTime/Calendar/Discordian.pm line 389. > > Use of uninitialized value in substitution iterator at > > /home/jf/perl5/lib/perl5/DateTime/Calendar/Discordian.pm line 526. > > Discordian > > 3182--St. Tib's Day, St. Tib's Day 3182 > > > > What is wrong? Can you fix please?
> > It is the %b (season abbreviation) specification. St Tib's Day doesn't belong to any season so of course it doesn't have a season abbreviation and so %b = undef. The correct way to deal with it is to enclose it in %{ %} as you already have in the next part of the format string. > > So I don't really think this is a bug. Or do you think maybe %b (and %B) should return q{} instead of undef in this case? >
I should have reread the module's POD. With your explanation, I agree this is not a bug. I will close my ticket. Excuse me for the disruption. Jean Forget