Re: [perl #46073] split function broken on MacOS On 2007â10â05, at 01:54, fjzbq@etmac.local (via RT) wrote:

> The split function fails to work properly on MacOS 10.4.10, either  
> using the
> builtin perl (v5.8.6) or v5.8.8 from the MacPorts project (which  
> I'm using to
> run perlbug.
>
> For example, running this command
>
>  perl -e 'print join(":", split(/ */, "hi there"));'
>
> produces no output on MacOS,

Looks like a documentation error to me: the output is produced, but  
you don't see it because there's no line-end sequence. It seems that  
the Terminal app does not display output in this situation. (Neither  
does xterm, as shipped by Apple -- I don't have any other terminal  
emulators around to try.)

perl -le 'print join(":", split(/ */, "hi there"));'

lets you see it, as does

perl -e 'print join(":", split(/ */, "hi there"));' | od -c


> but produces
>
> h:i:t:h:e:r:e
>
> as expected with perl v5.8.8 on Ubuntu 7.04

I'd expect it to produce

h:i:t:h:e:r:eYourPS1Prompt$

Is that what happens?

Sorry I don't have time to dash off a doc patch just now. Will do it  
later if nobody steps into the breach.
-- 
Dominic Dunlop



