[Bps-public-commit] r13093 - in Date-Extract: lib/Date

sartak at bestpractical.com sartak at bestpractical.com
Mon Jun 9 19:32:25 EDT 2008


Author: sartak
Date: Mon Jun  9 19:32:25 2008
New Revision: 13093

Modified:
   Date-Extract/   (props changed)
   Date-Extract/lib/Date/Extract.pm

Log:
 r61819 at onn:  sartak | 2008-06-09 12:57:49 -0400
 Better handling of Date::Extract->extract (which before didn't default the arguments)


Modified: Date-Extract/lib/Date/Extract.pm
==============================================================================
--- Date-Extract/lib/Date/Extract.pm	(original)
+++ Date-Extract/lib/Date/Extract.pm	Mon Jun  9 19:32:25 2008
@@ -192,11 +192,12 @@
     my $text = shift;
     my %args = @_;
 
+    # using extract as a class method
+    $self = $self->new
+        if !ref($self);
+
     # combine the arguments of parser->new and this
-    # don't do this if called as a class method,
-    # since there was no constructor call
-    $self->_combine_args($self, \%args)
-        if ref($self);
+    $self->_combine_args($self, \%args);
 
     # when in scalar context, downgrade
     $args{returns} = $self->_downgrade($args{returns})



More information about the Bps-public-commit mailing list