From: Ricardo SIGNES Date: Mon, 26 Jan 2009 15:07:12 +0000 (-0500) Subject: deprecate UNIVERSAL->import X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1d9f57de1578571277e83372972a28d6d830e713;p=p5sagit%2Fp5-mst-13.2.git deprecate UNIVERSAL->import --- diff --git a/lib/UNIVERSAL.pm b/lib/UNIVERSAL.pm index 891c784..01a16ca 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, C, and C), -however it is usually harmful to do so. Please don't do this in new code. +B. Please don't do this in +new code. For example, previous versions of this documentation suggested using C as a function to determine the type of a reference: