I'm working with a byte oriented protocol, and need to extract byte n1 through
byte n2 from a string. Problem is, the string can be UTF8, and substr() is
character oriented. What (if anything) is the best way to do this in Perl?
Any/all ideas welcome. I would prefer a pure Perl (non XS) solution,
On Wed, Aug 27, 2003 at 06:04:48PM +0200, Guido Flohr wrote:
> Hi,
>
> [EMAIL PROTECTED] wrote:
> >I'm working with a byte oriented protocol, and need to extract byte n1
> >through
> >byte n2 from a string.
>
> I read this as "*character* n1 through *character* n2", right?
Alas, no -- I'm inte
I'm confused, can someone tell me why:
#!/usr/bin/perl
use bytes;
$x = chr( 400 );
print "Length is ", length( $x ), "\n";
prints 1, while
#!/usr/bin/perl
$x = chr( 400 );
use bytes;
print "Length is ", length( $x ), "\n";
prints 2?
% perl -v
This is perl, v