Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[perl #63970] split() returns the delimiter, not the substrings

0 views
Skip to first unread message

Gabor Szabo

unread,
Mar 18, 2009, 6:10:08 PM3/18/09
to bugs-bi...@netlabs.develooper.com
# New Ticket Created by Gabor Szabo
# Please include the string: [perl #63970]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=63970 >


perl6 -e'say "a;b".split(";").perl'
["a", "b"]

but

perl6 -e'say split("a;b", ";")'
;


Gabor

Moritz Lenz

unread,
Mar 18, 2009, 7:18:32 PM3/18/09
to perl6-c...@perl.org

In the sub form the delimiter still goes first (like in Perl 5), so it
tries to split ';' by 'a;b', fails, and thus returns the whole string is
one chunk. Works as designed.

Cheers,
Moritz

Gabor Szabo

unread,
Mar 19, 2009, 2:21:55 AM3/19/09
to Moritz Lenz, perl6-c...@perl.org

and I even reported it as a bug

how embarrassing

I blame the hour.

Gabor

0 new messages