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 box.
>
> ~$ perl -e 'for(0..256) { $s.=chr($_) } for(split(//,$s)) { print }'
>
>
> 123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿA-
>
> perl -V gives:
>
> Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration:
>    Platform:
>      osname=linux, osvers=2.4.18-11smp, archname=i386-linux-thread-multi
>      uname='linux daffy.perf.redhat.com 2.4.18-11smp #1 smp thu aug 15
> 06:41:59 edt 2002 i686
>   i686 i386 gnulinux '
>      config_args='-des -Doptimize=-O2 -march=i386 -mcpu=i686
> -Dmyhostname=localhost -Dperladm
> in=root@localhost -Dcc=gcc -Dcf_by=Red Hat, Inc. -Dinstallprefix=/usr
> -Dprefix=/usr -Darchna
> me=i386-linux -Dvendorprefix=/usr -Dsiteprefix=/usr -Duseshrplib
> -Dusethreads -Duseithreads
> -Duselargefiles -Dd_dosuid -Dd_semctl_semun -Di_db -Ui_ndbm -Di_gdbm
> -Di_shadow -Di_syslog -
> Dman3ext=3pm -Duseperlio -Dinstallusrbinperl -Ubincompat5005
> -Uversiononly -Dpager=/usr/bin/
> less -isr'
>      hint=recommended, useposix=true, d_sigaction=define
>      usethreads=define use5005threads=undef useithreads=define
> usemultiplicity=define
>      useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
>      use64bitint=undef use64bitall=undef uselongdouble=undef
>      usemymalloc=n, bincompat5005=undef
>    Compiler:
>      cc='gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing
> -D_LARGEFILE_SOURCE
> -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm',
>      optimize='-O2 -march=i386 -mcpu=i686',
>      cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing
> -I/usr/include/gdbm'
>      ccversion='', gccversion='3.2 20020822 (Red Hat Linux Rawhide
> 3.2-5)', gccosandvers=''
>      intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
>      d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
>      ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
> lseeksize=8
>      alignbytes=4, prototype=define
>    Linker and Libraries:
>      ld='gcc', ldflags =' -L/usr/local/lib'
>      libpth=/usr/local/lib /lib /usr/lib
>      libs=-lnsl -lgdbm -ldb -ldl -lm -lpthread -lc -lcrypt -lutil
>      perllibs=-lnsl -ldl -lm -lpthread -lc -lcrypt -lutil
>      libc=/lib/libc-2.2.92.so, so=so, useshrplib=true, libperl=libperl.so
>      gnulibc_version='2.2.92'
>    Dynamic Linking:
>      dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic
> -Wl,-rpath,/usr/lib/
> perl5/5.8.0/i386-linux-thread-multi/CORE'
>      cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'
>
>
> Characteristics of this binary (from libperl):
>    Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES
> PERL_IMPLICIT_CONTEXT
>    Built under linux
>    Compiled at Sep  1 2002 23:56:49
>    @INC:
>      /usr/lib/perl5/5.8.0/i386-linux-thread-multi
>      /usr/lib/perl5/5.8.0
>      /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi
>      /usr/lib/perl5/site_perl/5.8.0
>      /usr/lib/perl5/site_perl
>      /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi
>      /usr/lib/perl5/vendor_perl/5.8.0
>      /usr/lib/perl5/vendor_perl
>      .
>
>
> It also appears to work the same on my G4 Ti Powerbook, which is Perl
> 5.6.0 with various Fink additions.

  I have tested it under FreeBSD 4.4-RELEASE (VKERN) #7 with the Bash shell (perl, 
v5.6.1 built for i386-freebsd), and under Win2K
(5.0.2195 Service Pack 3 Build 2195) (perl, v5.6.1 built for MSWin32-x86-multi-thread).
  So, I guess this is only an issue with 5.6.1.  I will upgrade where I can and use 
'use bytes' where I can't.  Thanks for the solve
Rob.

I am curious now though about the character output.  On Win2k I get:

C:\>perl -e "use bytes; for(0..256) { $s.=chr($_) } for(split(//,$s)) { print }"
 ☺☻♥♦♣
♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñ
Ѫº¿⌐¬½¼¡
«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■

On FreeBSD, I get:

% perl -e 'use bytes; for(0..256) { $s.=chr($_) } for(split(//,$s)) { print }'



 
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ
¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ

I understand the difference of characters between win2k and *nix, but shouldn't the 
output of FreeBSD and RedHat be the same?  The
trailing characters seem to be different here, or is this just an extra couple of 
characters brought over in the cut and paste?

> ~$ perl -e 'for(0..256) { $s.=chr($_) } for(split(//,$s)) { print }'
>
>
> 123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿA-

Shawn

>
> Hope this helps in some way...
>
> http://danconia.org
>
>
> Rob Dixon wrote:
> > 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 all will be well. The chr(256) will be
> > constrained to eight bits and add a NUL character instead of a multibyte
> > one.
> >
> > Could someone in the know tell us more about this please? I knew something
> > of the sort had been reported for 5.8.0, but it's caused me problems on
> > 5.6.1.
> >
> > Cheers,
> >
> > Rob
> >
> >
> > "Shawn B" <[EMAIL PROTECTED]> wrote in message
> > 04a501c2ae9a$4f91b160$0100a8c0@nam">news:04a501c2ae9a$4f91b160$0100a8c0@nam...
> >
> >>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.=chr($_) } for(split(//,$s)) { print }'
> >>Split loop at -e line 1.
> >>
> >>TIA,
> >>Shawn



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to