From: Rafael Garcia-Suarez Date: Thu, 26 Apr 2007 12:47:57 +0000 (+0000) Subject: Do the same thing as change #31082, but for warnings.pm. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f2c3e82948673f4d7e5fb945151780b94dc3862a;p=p5sagit%2Fp5-mst-13.2.git Do the same thing as change #31082, but for warnings.pm. p4raw-link: @31082 on //depot/perl: e3def60f2e5ccd1bf34656c3a5e1691f3bdc48a9 p4raw-id: //depot/perl@31084 --- diff --git a/lib/warnings.pm b/lib/warnings.pm index 74287f0..06e25c5 100644 --- a/lib/warnings.pm +++ b/lib/warnings.pm @@ -6,7 +6,14 @@ package warnings; -our $VERSION = '1.05'; +our $VERSION = '1.06'; + +# Verify that we're called correctly so that warnings will work. +# see also strict.pm. +unless ( __FILE__ =~ /(^|[\/\\])\Q@{[__PACKAGE__]}\E\.pm$/ ) { + my (undef, $f, $l) = caller; + die("Incorrect use of pragma '@{[__PACKAGE__,]}' at $f line $l.\n"); +} =head1 NAME diff --git a/warnings.pl b/warnings.pl index c22d110..d342a39 100644 --- a/warnings.pl +++ b/warnings.pl @@ -437,7 +437,14 @@ __END__ package warnings; -our $VERSION = '1.05'; +our $VERSION = '1.06'; + +# Verify that we're called correctly so that warnings will work. +# see also strict.pm. +unless ( __FILE__ =~ /(^|[\/\\])\Q@{[__PACKAGE__]}\E\.pm$/ ) { + my (undef, $f, $l) = caller; + die("Incorrect use of pragma '@{[__PACKAGE__,]}' at $f line $l.\n"); +} =head1 NAME