diff --git a/lib/utf8.pm b/lib/utf8.pm index 905b5ceb4b35..fca8f127e673 100644 --- a/lib/utf8.pm +++ b/lib/utf8.pm @@ -1,13 +1,16 @@ package utf8; +# This file only defines the import/unimport subs, the rest are implemented by +# always-present functions in the perl interpreter itself. +# See also `universal.c` in the perl source + use strict; use warnings; our $utf8_hint_bits = 0x00800000; our $ascii_hint_bits = 0x00000010; # Turned off when utf8 turned on -our $VERSION = '1.27'; -our $AUTOLOAD; +our $VERSION = '1.28'; sub import { $^H |= $utf8_hint_bits; @@ -18,12 +21,6 @@ sub unimport { $^H &= ~$utf8_hint_bits; } -sub AUTOLOAD { - goto &$AUTOLOAD if defined &$AUTOLOAD; - require Carp; - Carp::croak("Undefined subroutine $AUTOLOAD called"); -} - 1; __END__ diff --git a/lib/utf8.t b/lib/utf8.t index fa69fcbb8862..89ed1dd1bbcb 100644 --- a/lib/utf8.t +++ b/lib/utf8.t @@ -557,8 +557,8 @@ SKIP: { { fresh_perl_like ('use utf8; utf8::moo()', - qr/Undefined subroutine utf8::moo/, {stderr=>1}, - "Check Carp is loaded for AUTOLOADing errors") + qr/Undefined subroutine &utf8::moo/, {stderr=>1}, + "Check undefined subroutines error") } {