Do the same thing as change #31082, but for warnings.pm.
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Thu, 26 Apr 2007 12:47:57 +0000 (12:47 +0000)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Thu, 26 Apr 2007 12:47:57 +0000 (12:47 +0000)
p4raw-link: @31082 on //depot/perl: e3def60f2e5ccd1bf34656c3a5e1691f3bdc48a9

p4raw-id: //depot/perl@31084

lib/warnings.pm
warnings.pl

index 74287f0..06e25c5 100644 (file)
@@ -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
 
index c22d110..d342a39 100644 (file)
@@ -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