[snip]
> On FreeBSD, I get:
>
> % perl -e 'use bytes; for(0..256) { $s.=chr($_) } for(split(//,$s)) { print }'
>
>
>
>
>!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ
>
>¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍ
Thanks for the reponses,
See below:
- Original Message -
From: "Wiggins d'Anconia" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, December 28, 2002 3:28 PM
Subject: Re: split error
> The original posted perl line worked fine on my RH8.0 b
The original posted perl line worked fine on my RH8.0 box.
~$ perl -e 'for(0..256) { $s.=chr($_) } for(split(//,$s)) { print }'
123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øù
Hi Shawn
I'll stick my neck out and say that this is a bug in Perl, to do with
Unicode support. Running the loop from 0..256 gives you 256 8-bit characters
and one 16-bit character (0x0100 = 256). This seems to upset split() as it
stands. Try adding:
use bytes;
at the start of your code, and
;)
-Original Message-
From: Shawn B [mailto:[EMAIL PROTECTED]]
Sent: Saturday, December 28, 2002 09:55
To: [EMAIL PROTECTED]
Subject: split error
Hello all,
Can anyone explain why this fails? I have done a google search for 'Split
loop at', and turned up nothing. If the initial array
s
Hello all,
Can anyone explain why this fails? I have done a google search for 'Split loop at',
and turned up nothing. If the initial array
stays under 256, all is fine, but anything beyond 255 (as far as I have tested) dies.
Is this something to do with bit size?
%perl -e 'for(0..256) { $s.