summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-04-26 12:47:57 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-04-26 12:47:57 +0000
commitf2c3e82948673f4d7e5fb945151780b94dc3862a (patch)
tree8d1226a3b5b8b39063a81024275ecfc38ac23015
parente9e03e16875c2b55d3621425adb98b63af46989f (diff)
downloadperl-f2c3e82948673f4d7e5fb945151780b94dc3862a.tar.gz
Do the same thing as change #31082, but for warnings.pm.
p4raw-link: @31082 on //depot/perl: e3def60f2e5ccd1bf34656c3a5e1691f3bdc48a9 p4raw-id: //depot/perl@31084
-rw-r--r--lib/warnings.pm9
-rw-r--r--warnings.pl9
2 files changed, 16 insertions, 2 deletions
diff --git a/lib/warnings.pm b/lib/warnings.pm
index 74287f07c5..06e25c58ad 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 c22d110eee..d342a39fa6 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