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,@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

Attachment: signature.asc
Description: Digital signature

Reply via email to