From: Johan Vromans Date: Wed, 25 Apr 2007 16:12:58 +0000 (+0200) Subject: Re: The Strict trap X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e3def60f2e5ccd1bf34656c3a5e1691f3bdc48a9;p=p5sagit%2Fp5-mst-13.2.git Re: The Strict trap Message-ID: p4raw-id: //depot/perl@31082 --- diff --git a/ext/Storable/t/code.t b/ext/Storable/t/code.t index 81e8b90..c3c988b 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 d14391a..bcb1321 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