From bd7017d37d1ea75ed228b98d66032e165497283f Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Thu, 13 Jan 2005 13:50:40 +0000 Subject: [PATCH] utf.pm needs to require Carp before croak()ing p4raw-id: //depot/perl@23788 --- lib/utf8.pm | 1 + lib/utf8.t | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/utf8.pm b/lib/utf8.pm index 817a61c..e0b9f85 100644 --- a/lib/utf8.pm +++ b/lib/utf8.pm @@ -16,6 +16,7 @@ sub unimport { sub AUTOLOAD { require "utf8_heavy.pl"; goto &$AUTOLOAD if defined &$AUTOLOAD; + require Carp; Carp::croak("Undefined subroutine $AUTOLOAD called"); } diff --git a/lib/utf8.t b/lib/utf8.t index 576d90e..70ef1e3 100644 --- a/lib/utf8.t +++ b/lib/utf8.t @@ -37,7 +37,7 @@ no utf8; # Ironic, no? # # -plan tests => 145; +plan tests => 146; { # bug id 20001009.001 @@ -425,3 +425,9 @@ SKIP: { utf8::upgrade($b); is($b, $a, "utf8::upgrade OffsetOK"); } + +{ + fresh_perl_like ('use utf8; utf8::moo()', + qr/Undefined subroutine utf8::moo/, {stderr=>1}, + "Check Carp is loaded for AUTOLOADing errors") +} -- 2.7.4