On May 12, 2005, at 11:59 AM, Autrijus Tang wrote:
> On Thu, May 12, 2005 at 04:53:06PM +0200, "TSa (Thomas Sandla�)"
> wrote:
>> Autrijus Tang wrote:
>>
>>> pugs> split /(..)*/, 1234567890
>>> ('', '12', '34', '56', '78', '90')
>>>
>>> Is this sane?
>>
>> Why the empty string match at the start?
>
> I don't know, I didn't invent that! :-)
>
> $ perl -le 'print join ",", split /(..)/, 123'
> ,12,3
This makes sense when I think about what split is doing, but it is
surprising at first glance. Perhaps this should be included as an
example in the docs?
--Dks
Thread Previous
|
Thread Next