This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix version::is_strict/is_lax exporting
authorDavid Golden <dagolden@cpan.org>
Sun, 25 Apr 2010 23:51:07 +0000 (19:51 -0400)
committerDavid Golden <dagolden@cpan.org>
Mon, 26 Apr 2010 00:32:12 +0000 (20:32 -0400)
These were being exported with a wrapper that treated them as method
calls, which causes them to fail.  They are just functions, are
documented as such, and should never be subclassed, so this patch
just exports them directly as functions without the wrapper.

lib/version.pm

index 60e5d6d..405eb10 100644 (file)
@@ -157,15 +157,11 @@ sub import {
     }
 
     if (exists($args{'is_strict'})) {
-       *{$callpkg.'::is_strict'} = 
-           sub {return $class->is_strict(shift)}
-         unless defined(&{$callpkg.'::is_strict'});
+       *{$callpkg.'::is_strict'} = \&version::is_strict;
     }
 
     if (exists($args{'is_lax'})) {
-       *{$callpkg.'::is_lax'} = 
-           sub {return $class->is_lax(shift)}
-         unless defined(&{$callpkg.'::is_lax'});
+       *{$callpkg.'::is_lax'} = \&version::is_lax;
     }
 }