X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Fwarnings.pm;h=06e25c58ad941c1cad53b116af4b22ea723a85ce;hb=192b9cd13b3ba000f1d0a2d32c141b9513be7936;hp=85ce3de7471b8641ac29c9fd3fc4e192f2d060da;hpb=29ddba3bfaa890fa4ba09cd9e59d0dd375d96279;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/warnings.pm b/lib/warnings.pm index 85ce3de..06e25c5 100644 --- a/lib/warnings.pm +++ b/lib/warnings.pm @@ -6,7 +6,14 @@ package warnings; -our $VERSION = '1.04'; +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 @@ -296,6 +303,7 @@ $All = "" ; vec($All, $Offsets{'all'}, 2) = 3 ; sub Croaker { require Carp::Heavy; # this initializes %CarpInternal + local $Carp::CarpInternal{'warnings'}; delete $Carp::CarpInternal{'warnings'}; Carp::croak(@_); }