Larry Wall wrote:
> On Fri, Sep 19, 2008 at 05:58:59PM +0200, Moritz Lenz wrote:
> : Hi,
> :
> : what should ''.split('') return? The empty list, or a list with one null
> : string?
>
> Empty list would make more sense as a degenerate case. In
>
> 'a'.split('')
>
> we don't return the null strings before or after 'a', just ('a').
And with the same argumentation the same holds true for regexes as well?
'a'.split(rx/a/) # also empty list
''.split(rx/ '' /) # dito
Moritz
--
Moritz Lenz
http://moritz.faui2k3.org/ | http://perl-6.de/