New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
split function broken on MacOS #9050
Comments
From erict@etmac.localCreated by erict@etmac.localThis is a bug report for perl from erict@etmac.local, ----------------------------------------------------------------- For example, running this command perl -e 'print join(":", split(/ */, "hi there"));' produces no output on MacOS, but produces h:i:t:h:e:r:e as expected with perl v5.8.8 on Ubuntu 7.04 I could create a simpler example, but this is sort of canonical, and Perl Info
|
From shouldbedomo@mac.comOn 2007–10–05, at 01:54, erict@etmac.local (via RT) wrote:
Looks like a documentation error to me: the output is produced, but perl -le 'print join(":", split(/ */, "hi there"));' lets you see it, as does perl -e 'print join(":", split(/ */, "hi there"));' | od -c
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 |
The RT System itself - Status changed from 'new' to 'open' |
From @JohnPeacockerict@etmac.local (via RT) wrote:
Out of curiousity, can you replicate command? $ perl -MO=Deparse -e 'print join(":", split(/ */, "hi there"));' I'm just trying to confirm that there isn't some weird shell interaction (yes, I John |
From @eserte
I don't think it's a terminal issue, and it's even not a shell issue. It's PROMPT="^M> " (The ^M is a literal \r, typed in with Ctrl-V Ctrl-M) If I set the prompt like this, then it seems that the perl oneliner It is my impression that some default shell resource files have similar Regards, |
From jos@dwim.orgOn 05 Oct 2007, at 01:54, erict@etmac.local (via RT) wrote:
$ perl -le 'print join(":", split(/ */, "hi there"));' $ uname -a
Default perl version 10.4.10 is currently 5.8.6, which makes me think For me, both the stock perl and my own compiled 5.8.8 work as expected,
-- Jos Boumans How do I prove I'm not crazy to people who are? |
From shouldbedomo@mac.comOn 2007–10–05, at 13:52, slaven@rezic.de wrote:
Thanks for that clarification. Anyway, the promised doc patch is |
From @TuxOn Fri, 5 Oct 2007 16:20:30 +0200, Dominic Dunlop <shouldbedomo@mac.com>
You made it too ugly imho - print join(':', split(/ */, 'hi there')); -- |
From shouldbedomo@mac.comOn 2007–10–05, at 16:43, H.Merijn Brand wrote:
But that produces slightly different output: $ perl -- |
From @tamiasOn Fri, Oct 05, 2007 at 02:43:18PM +0000, H.Merijn Brand wrote:
Should be: print join(':', split(/ */, 'hi there')), "\n"; Ronald |
From shouldbedomo@mac.comOn 2007–10–05, at 16:59, Ronald J Kimball wrote:
Revised, less uglifying, version of patch attached. |
From @schwernerict@etmac.local (via RT) wrote:
I cannot reproduce this problem on OS X 10.4.10 using Terminal and either Could you show us the output of "env"? -- |
From @schwernDominic Dunlop wrote:
Maybe it should use say? -- |
From @apHi Dominic, * Dominic Dunlop <shouldbedomo@mac.com> [2007-10-05 17:00]:
FWIW I always write this sort of thing as print join( ... ) . "\n" instead. No subtleties to remember. I also generally omit parens print join(':', split / */, 'hi there') . "\n"; Much easier to read off, IMO. -- |
From p5p@perl.wizbit.beAdds a "\n" in the examples of split. The attached patch (or at least one similar) was submitted before but The original bug report/patches (from October 2007): Kind regards, Bram |
From @rgs2008/4/27 Bram <p5p@perl.wizbit.be>:
Thanks, applied. |
@rgs - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#46073 (status was 'resolved')
Searchable as RT46073$
The text was updated successfully, but these errors were encountered: