dist/Module-CoreList/META.yml Module::CoreList
dist/Module-CoreList/README Module::CoreList
dist/Module-CoreList/t/corelist.t Module::CoreList tests
+dist/Module-CoreList/t/deprecated.t Module::CoreList tests
dist/Module-CoreList/t/find_modules.t Module::CoreList tests
dist/Module-CoreList/t/pod.t Module::CoreList tests
dist/Net-Ping/Changes Net::Ping
Makefile.PL
META.yml
t/corelist.t
+t/deprecated.t
t/find_modules.t
t/pod.t
package Module::CoreList;
use strict;
use vars qw/$VERSION %released %version %families %upstream
- %bug_tracker/;
-$VERSION = '2.21';
+ %bug_tracker %deprecated/;
+$VERSION = '2.22';
=head1 NAME
return undef;
}
+sub is_deprecated {
+ my ($discard, $module, $perl) = @_;
+ return unless $module and exists $deprecated{ $module };
+ $perl = $] unless $perl and exists $version{ $perl };
+ return $deprecated{ $module } if
+ $perl >= $deprecated{ $module };
+}
+
# When things escaped.
# NB. If you put version numbers with trailing zeroes here, you
# should also add an alias for the numerical ($]) version; see
'version' => undef,
);
+# Deprecated modules and the version they were deprecated
+%deprecated = (
+ 'Switch' => '5.011',
+);
# Create aliases with trailing zeros for $] use
--- /dev/null
+#!perl -w
+use strict;
+use Module::CoreList;
+use Test::More tests => 3;
+
+is(Module::CoreList->is_deprecated('Switch',5.011),'5.011','Switch is deprecated');
+is(Module::CoreList->is_deprecated('Switch',5.011000),'5.011','Switch is deprecated using $]');
+is(Module::CoreList->is_deprecated('Switch',5.010),'','Switch is not deprecated');