summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Vromans <jvromans@squirrel.nl>2007-04-25 18:12:58 +0200
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-04-26 10:51:36 +0000
commite3def60f2e5ccd1bf34656c3a5e1691f3bdc48a9 (patch)
tree9c2128ee1837af849384fcbe30051d4c40a82578
parent32e6a07c84b153f78f946de50870bc0ee030624f (diff)
downloadperl-e3def60f2e5ccd1bf34656c3a5e1691f3bdc48a9.tar.gz
Re: The Strict trap
Message-ID: <m2lkggilud.fsf@phoenix.squirrel.nl> p4raw-id: //depot/perl@31082
-rw-r--r--ext/Storable/t/code.t2
-rw-r--r--lib/strict.pm13
2 files changed, 13 insertions, 2 deletions
diff --git a/ext/Storable/t/code.t b/ext/Storable/t/code.t
index 81e8b9037d..c3c988b458 100644
--- a/ext/Storable/t/code.t
+++ b/ext/Storable/t/code.t
@@ -242,7 +242,7 @@ ok(prototype($thawed->[4]), prototype($obj[0]->[4]));
{
my $safe = new Safe;
# because of opcodes used in "use strict":
- $safe->permit(qw(:default require));
+ $safe->permit(qw(:default require caller));
local $Storable::Eval = sub { $safe->reval(shift) };
$freezed = freeze $obj[0]->[1];
diff --git a/lib/strict.pm b/lib/strict.pm
index d14391add4..bcb1321613 100644
--- a/lib/strict.pm
+++ b/lib/strict.pm
@@ -1,6 +1,13 @@
package strict;
-$strict::VERSION = "1.03";
+$strict::VERSION = "1.04";
+
+# Verify that we're called correctly so that strictures will work.
+unless ( __FILE__ =~ /(^|[\/\\])\Q@{[__PACKAGE__]}\E\.pm$/ ) {
+ # Can't use Carp, since Carp uses us!
+ my (undef, $f, $l) = caller;
+ die("Incorrect use of pragma '@{[__PACKAGE__,]}' at $f line $l.\n");
+}
my %bitmask = (
refs => 0x00000002,
@@ -133,4 +140,8 @@ if unknown restrictions are used, the strict pragma will abort with
Unknown 'strict' tag(s) '...'
+As of version 1.04 (Perl 5.10), strict verifies that it is used as
+"strict" to avoid the dreaded Strict trap on case insensitive file
+systems.
+
=cut