From: Nicholas Clark Date: Thu, 13 Jan 2005 13:50:40 +0000 (+0000) Subject: utf.pm needs to require Carp before croak()ing X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bd7017d37d1ea75ed228b98d66032e165497283f;p=p5sagit%2Fp5-mst-13.2.git utf.pm needs to require Carp before croak()ing p4raw-id: //depot/perl@23788 --- 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") +}