diff options
author | SADAHIRO Tomoyuki <BQW10602@nifty.com> | 2005-05-27 08:46:35 +0900 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2005-05-27 11:20:03 +0000 |
commit | e3caa66837cca0bf95aee71104113732a3277c97 (patch) | |
tree | 857207641ba2e3bf7eb383a71c98b4f6c556561a | |
parent | e9817721b4c5885c8c414599167c18916124f594 (diff) | |
download | perl-e3caa66837cca0bf95aee71104113732a3277c97.tar.gz |
Integrate:
[ 24360]
Fix [perl #35162] $SIG{__DIE__} = 'IGNORE' is base.pm is illegal
[ 24585]
Subject: [PATCH] bytes.pm doesn't check undefined subroutine calling
Message-Id: <20050526234321.92F1.BQW10602@nifty.com>
p4raw-link: @24585 on //depot/perl: 5b5a256ab100c58f58aab1b20dc1f7777b745fd1
p4raw-link: @24360 on //depot/perl: a7fce7e16a936eb048fedb9b30adc592bcb2c657
p4raw-id: //depot/maint-5.8/perl@24600
p4raw-integrated: from //depot/perl@24599 'copy in' lib/bytes.t
(@21016..) lib/bytes.pm (@21017..) lib/base.pm (@23267..)
-rw-r--r-- | lib/base.pm | 4 | ||||
-rw-r--r-- | lib/bytes.pm | 6 | ||||
-rw-r--r-- | lib/bytes.t | 8 |
3 files changed, 13 insertions, 5 deletions
diff --git a/lib/base.pm b/lib/base.pm index 832b6a4a9a..001914be4d 100644 --- a/lib/base.pm +++ b/lib/base.pm @@ -2,7 +2,7 @@ package base; use strict 'vars'; use vars qw($VERSION); -$VERSION = '2.06'; +$VERSION = '2.07'; # constant.pm is slow sub SUCCESS () { 1 } @@ -78,7 +78,7 @@ sub import { unless defined ${$base.'::VERSION'}; } else { - local $SIG{__DIE__} = 'IGNORE'; + local $SIG{__DIE__}; eval "require $base"; # Only ignore "Can't locate" errors from our eval require. # Other fatal errors (syntax etc) must be reported. diff --git a/lib/bytes.pm b/lib/bytes.pm index 9a04491daf..a8222794dd 100644 --- a/lib/bytes.pm +++ b/lib/bytes.pm @@ -1,6 +1,6 @@ package bytes; -our $VERSION = '1.01'; +our $VERSION = '1.02'; $bytes::hint_bits = 0x00000008; @@ -14,7 +14,9 @@ sub unimport { sub AUTOLOAD { require "bytes_heavy.pl"; - goto &$AUTOLOAD; + goto &$AUTOLOAD if defined &$AUTOLOAD; + require Carp; + Carp::croak("Undefined subroutine $AUTOLOAD called"); } sub length ($); diff --git a/lib/bytes.t b/lib/bytes.t index 6b66a554b2..ea1b9f629b 100644 --- a/lib/bytes.t +++ b/lib/bytes.t @@ -4,7 +4,7 @@ BEGIN { require './test.pl'; } -plan tests => 19; +plan tests => 20; my $a = chr(0x100); @@ -46,3 +46,9 @@ my $c = chr(0x100); is(bytes::index($c, "\x80"), 1, "bytes::index under use bytes looks at bytes"); is(bytes::rindex($c, "\xc4"), 0, "bytes::rindex under use bytes looks at bytes"); } + +{ + fresh_perl_like ('use bytes; bytes::moo()', + qr/Undefined subroutine bytes::moo/, {stderr=>1}, + "Check Carp is loaded for AUTOLOADing errors") +} |