diff options
author | Chris Williams <chris@bingosnet.co.uk> | 2010-04-21 09:47:27 +0100 |
---|---|---|
committer | Chris Williams <chris@bingosnet.co.uk> | 2010-04-21 09:49:25 +0100 |
commit | 6d7c3a122b88499ed48224f66cf9462018649bb2 (patch) | |
tree | ab1fa658897058aeeb62d6f4d980166cb8895381 /dist | |
parent | b45874b5099b6e9493fb68a7993c7cecee2345fe (diff) | |
download | perl-6d7c3a122b88499ed48224f66cf9462018649bb2.tar.gz |
Make the Module::CoreList function API consistent
Some functions could only be called with class method type syntax.
Other functions could only be called with normal sub syntax.
This makes the API consistent, functions can be called with
either syntax.
Diffstat (limited to 'dist')
-rw-r--r-- | dist/Module-CoreList/lib/Module/CoreList.pm | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/dist/Module-CoreList/lib/Module/CoreList.pm b/dist/Module-CoreList/lib/Module/CoreList.pm index 57d8ffccf5..911e9d6474 100644 --- a/dist/Module-CoreList/lib/Module/CoreList.pm +++ b/dist/Module-CoreList/lib/Module/CoreList.pm @@ -100,7 +100,9 @@ END { sub first_release_raw { - my ($discard, $module, $version) = @_; + my $module = shift; + $module = shift if $module->isa(__PACKAGE__); + my $version = shift; my @perls = $version ? grep { exists $version{$_}{ $module } && @@ -123,8 +125,8 @@ sub first_release { } sub find_modules { - my $discard = shift; my $regex = shift; + $regex = shift if $regex->isa(__PACKAGE__); my @perls = @_; @perls = keys %version unless @perls; @@ -138,13 +140,17 @@ sub find_modules { } sub find_version { - my ($class, $v) = @_; + my $class = shift; + $class = shift if $class->isa(__PACKAGE__); + my $v = shift; return $version{$v} if defined $version{$v}; return undef; } sub is_deprecated { - my ($module, $perl_version) = @_; + my $module = shift; + $module = shift if $module->isa(__PACKAGE__); + my $perl_version = shift; $perl_version ||= $]; return unless $module && exists $deprecated{$perl_version}{$module}; return $deprecated{$perl_version}{$module}; |