Skip to content

Commit

Permalink
Make the Module::CoreList function API consistent
Browse files Browse the repository at this point in the history
  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.
  • Loading branch information
bingos committed Apr 21, 2010
1 parent b45874b commit 6d7c3a1
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions dist/Module-CoreList/lib/Module/CoreList.pm
Expand Up @@ -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 } &&
Expand All @@ -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;

Expand All @@ -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};
Expand Down

0 comments on commit 6d7c3a1

Please sign in to comment.