utf.pm needs to require Carp before croak()ing
authorNicholas Clark <nick@ccl4.org>
Thu, 13 Jan 2005 13:50:40 +0000 (13:50 +0000)
committerNicholas Clark <nick@ccl4.org>
Thu, 13 Jan 2005 13:50:40 +0000 (13:50 +0000)
p4raw-id: //depot/perl@23788

lib/utf8.pm
lib/utf8.t

index 817a61c..e0b9f85 100644 (file)
@@ -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");
 }
 
index 576d90e..70ef1e3 100644 (file)
@@ -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")
+}