Message-Id: <
20050526234321.92F1.BQW10602@nifty.com>
p4raw-id: //depot/perl@24585
package bytes;
-our $VERSION = '1.01';
+our $VERSION = '1.02';
$bytes::hint_bits = 0x00000008;
sub AUTOLOAD {
require "bytes_heavy.pl";
- goto &$AUTOLOAD;
+ goto &$AUTOLOAD if defined &$AUTOLOAD;
+ require Carp;
+ Carp::croak("Undefined subroutine $AUTOLOAD called");
}
sub length ($);
require './test.pl';
}
-plan tests => 19;
+plan tests => 20;
my $a = 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")
+}