This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
more prose fixups to bytes.pm deprecation warning
[perl5.git] / lib / bytes.pm
index 9a04491..918c8ee 100644 (file)
@@ -1,6 +1,6 @@
 package bytes;
 
-our $VERSION = '1.01';
+our $VERSION = '1.04';
 
 $bytes::hint_bits = 0x00000008;
 
@@ -14,12 +14,14 @@ sub unimport {
 
 sub AUTOLOAD {
     require "bytes_heavy.pl";
-    goto &$AUTOLOAD;
+    goto &$AUTOLOAD if defined &$AUTOLOAD;
+    require Carp;
+    Carp::croak("Undefined subroutine $AUTOLOAD called");
 }
 
-sub length ($);
-sub chr ($);
-sub ord ($);
+sub length (_);
+sub chr (_);
+sub ord (_);
 sub substr ($$;$$);
 sub index ($$;$);
 sub rindex ($$;$);
@@ -31,6 +33,18 @@ __END__
 
 bytes - Perl pragma to force byte semantics rather than character semantics
 
+=head1 DEPRECATED
+
+This pragma reflects early attempts to incorporate Unicode into perl and
+has since been superseded. It breaks encapsulation (i.e. it exposes the
+innards of how the perl executable currently happens to store a string),
+and use of this module for anything other than debugging purposes is
+strongly discouraged. If you feel that the functions here within might be
+useful for your application, this possibly indicates a mismatch beteen
+your mental model of Perl Unicode and the current reality. In that case,
+you may wish to peruse some of the perl Unicode documentation:
+L<perluniintro>, L<perlunitut>, L<perlunifaq> and L<perlunicode>.
+
 =head1 SYNOPSIS
 
     use bytes;