Bug#552996: libdate-simple-perl: today()/d8()/ymd() broken in subclasses
gregor herrmann
gregoa at debian.org
Thu Oct 29 13:06:47 UTC 2009
On Thu, 29 Oct 2009 02:38:32 +0000, Chris Share wrote:
> The expected result, which worked on an Etch system with version 3.01-1 of this package:
> perl -MDate::Simple::Fmt -e 'print Date::Simple::Fmt::today();'
> 2009-10-28
>
> The obtained result in this version:
> perl -MDate::Simple::Fmt -e 'print Date::Simple::Fmt::today();'
> Can't call method "_today" on an undefined value at /usr/lib/perl5/Date/Simple/Fmt.pm line 11.
The diff in e.g. lib/Date/Simple/Fmt.pm between 3.01 and 3.03.03 is
(ignoring line endings and space) is:
#v+
--- lib/Date/Simple/Fmt.pm (revision 13088)
+++ lib/Date/Simple/Fmt.pm (working copy)
@@ -7,15 +7,15 @@
*EXPORT_OK = *Date::Simple::EXPORT_OK;
*EXPORT_TAGS = *Date::Simple::EXPORT_TAGS;
-sub d8 { __PACKAGE__->_d8(@_) }
-sub today { __PACKAGE__->_today(@_) }
-sub ymd { __PACKAGE__->_ymd(@_) }
+sub d8 { shift->_d8(@_) }
+sub today { shift->_today(@_) }
+sub ymd { shift->_ymd(@_) }
sub new {
my ($class,$fmt, at args)=@_;
my $self=$class->SUPER::new(@args);
$self->default_format($fmt);
- $self
+ $self;
}
sub _format { shift->format() }
#v-
Short test:
$ PERL5LIB=lib perl -MDate::Simple::Fmt -e 'print Date::Simple::Fmt::today();'
Can't call method "_today" on an undefined value at lib/Date/Simple/Fmt.pm line 11.
$ PERL5LIB=lib perl -MDate::Simple::Fmt -e 'print Date::Simple::Fmt->today();'
2009-10-29
Cheers,
gregor
--
.''`. http://info.comodo.priv.at/ -- GPG Key IDs: 0x00F3CFE4, 0x8649AA06
: :' : Debian GNU/Linux user, admin, & developer - http://www.debian.org/
`. `' Member of VIBE!AT, SPI Inc., fellow of FSFE | http://got.to/quote/
`- NP: Paul McCartney & Wings: No More Lonely Nights (Special
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-perl-maintainers/attachments/20091029/e21031a7/attachment.pgp>
More information about the pkg-perl-maintainers
mailing list