From: Hugo van der Sanden Date: Thu, 24 Oct 2002 23:54:50 +0000 (+0000) Subject: 2 lines of change #18039 had several problems X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5c04bfc992a3719eced617efd59cb8f236465d3e;p=p5sagit%2Fp5-mst-13.2.git 2 lines of change #18039 had several problems p4raw-link: @18039 on //depot/perl: 40a3dda160f7716cf8fb3c9068ec08ae7f6c681e p4raw-id: //depot/perl@18060 --- diff --git a/ext/IO/IO.pm b/ext/IO/IO.pm index eb78c8a..6a4a7ff 100644 --- a/ext/IO/IO.pm +++ b/ext/IO/IO.pm @@ -10,8 +10,11 @@ XSLoader::load 'IO', $VERSION; sub import { shift; - warnings::warn('all', qq|parameterless "use IO" deprecated|) - if defined &warnings::warn && warnings::enabled('all'); + if (@_ == 0) { + require warnings; + warnings::warn('deprecated', qq{parameterless "use IO" deprecated}) + if warnings::enabled('deprecated'); + } my @l = @_ ? @_ : qw(Handle Seekable File Pipe Socket Dir); eval join("", map { "require IO::" . (/(\w+)/)[0] . ";\n" } @l)