Skip to content

Instantly share code, notes, and snippets.

@gfx
Created February 20, 2010 05:05
Show Gist options
  • Select an option

  • Save gfx/309508 to your computer and use it in GitHub Desktop.

Select an option

Save gfx/309508 to your computer and use it in GitHub Desktop.
diff --git a/cpan-outdated b/cpan-outdated
index fdb9331..9daa3ee 100755
--- a/cpan-outdated
+++ b/cpan-outdated
@@ -42,11 +42,14 @@ sub main {
my $inst_version = MM->parse_version($path);
$inst_version =~ s/\s+//; # workaround for Attribute::Params::Validate
if ($inst_version ne $version && CPAN::Version->vlt($inst_version, $version)) {
- next if $seen{$dist}++;
+ my $name = $dist;
+ $name =~ s{.+/}{}; # remove PAUSE ID
+ $name =~ s{-v?\d+\..+$}{}; # remove version and suffix
+ next if $seen{$name}++;
if ($verbose) {
printf "%-30s %-7s %-7s %s\n", $pkg, $inst_version, $version, $dist;
} else {
- print "$dist\n";
+ print "$pkg\n";
}
}
last SCAN_INC;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment