In perl.git, the branch rjbs/corelist-max-deprecated has been updated <http://perl5.git.perl.org/perl.git/commitdiff/6785463e32ae63e8e00b628b08a9e99070c10c8b?hp=cdac396140ede59138b67af076981d0438e36b8b>
- Log ----------------------------------------------------------------- commit 6785463e32ae63e8e00b628b08a9e99070c10c8b Author: Ricardo Signes <[email protected]> Date: Sun Mar 17 10:55:47 2013 -0400 assume current deprecations persist forever This might not be ideal. We might want, instead, to say that they are good only within the same version (not subversion) as the known data, and to give up if we know about 5.17.x and someone asks about 5.19.x ----------------------------------------------------------------------- Summary of changes: dist/Module-CoreList/lib/Module/CoreList.pm | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/dist/Module-CoreList/lib/Module/CoreList.pm b/dist/Module-CoreList/lib/Module/CoreList.pm index 5797608..aa3651c 100644 --- a/dist/Module-CoreList/lib/Module/CoreList.pm +++ b/dist/Module-CoreList/lib/Module/CoreList.pm @@ -68,12 +68,20 @@ sub find_version { return undef; } +my $max_deprecated; + sub is_deprecated { my $module = shift; $module = shift if eval { $module->isa(__PACKAGE__) } and scalar @_ and $_[0] =~ m#\A[a-zA-Z_][0-9a-zA-Z_]*(?:(::|')[0-9a-zA-Z_]+)*\z#; + + ($max_deprecated) = sort { $b cmp $a } keys %deprecated + if ! defined $max_deprecated; + my $perl_version = shift; $perl_version ||= $]; + $perl_version = $max_deprecated if $perl_version gt $max_deprecated; + return unless $module && exists $deprecated{$perl_version}{$module}; return $deprecated{$perl_version}{$module}; } -- Perl5 Master Repository
