in reply to Re: How do I safely, portably extract one or more bytes from a string?
in thread How do I safely, portably extract one or more bytes from a string?

Just to demo "use byte" as jweed mentioned.

use strict; my $a = chr(4000); { use bytes; print substr($a, 0, 1), "\n"; } { print substr($a, 0, 1), "\n"; }

You will see a warning saying "wide character in print", don't worry about that, that is what supposed to happen.

  • Comment on Re: Re: How do I safely, portably extract one or more bytes from a string?
  • Download Code