summaryrefslogtreecommitdiff
path: root/lib/UNIVERSAL.pm
diff options
context:
space:
mode:
authorRicardo SIGNES <rjbs@cpan.org>2009-01-26 10:07:12 -0500
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2009-02-07 15:32:56 +0100
commit1d9f57de1578571277e83372972a28d6d830e713 (patch)
tree1fa512dcc4385023e27fa45a76b52639e65a2f1a /lib/UNIVERSAL.pm
parent760739869681af2201302efa1672bfc02458a556 (diff)
downloadperl-1d9f57de1578571277e83372972a28d6d830e713.tar.gz
deprecate UNIVERSAL->import
Diffstat (limited to 'lib/UNIVERSAL.pm')
-rw-r--r--lib/UNIVERSAL.pm9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/UNIVERSAL.pm b/lib/UNIVERSAL.pm
index 891c784b76..01a16ca920 100644
--- a/lib/UNIVERSAL.pm
+++ b/lib/UNIVERSAL.pm
@@ -11,10 +11,16 @@ our $VERSION = '1.04';
require Exporter;
@EXPORT_OK = qw(isa can VERSION);
+require warnings;
+
# Make sure that even though the import method is called, it doesn't do
# anything unless called on UNIVERSAL.
sub import {
return unless $_[0] eq __PACKAGE__;
+ warnings::warnif(
+ 'deprecated',
+ 'UNIVERSAL->import is deprecated and will be removed in a future perl',
+ );
goto &Exporter::import;
}
@@ -181,7 +187,8 @@ available to your program (and you should not do so).
None by default.
You may request the import of three functions (C<isa>, C<can>, and C<VERSION>),
-however it is usually harmful to do so. Please don't do this in new code.
+B<but this feature is deprecated and will be removed>. Please don't do this in
+new code.
For example, previous versions of this documentation suggested using C<isa> as
a function to determine the type of a reference: