develooper Front page | perl.perl6.language | Postings from May 2005

Re: split /(..)*/, 1234567890

Thread Previous | Thread Next
From:
Jonathan Scott Duff
Date:
May 12, 2005 12:56
Subject:
Re: split /(..)*/, 1234567890
Message ID:
20050512195637.GE18077@pobox.com
On Thu, May 12, 2005 at 12:01:59PM -0700, Larry Wall wrote:
> On Thu, May 12, 2005 at 12:03:55PM -0500, Jonathan Scott Duff wrote:
> : I think that the above split should generate a list like this:
> : 
> : 	('', [ '12','34','56','78','90'])
> 
> Yes, though I would think of it more generally as
> 
>     ('', $0, '', $0, '', $0, ...)
> 
> where in this case it just happens to be
> 
>     ('', $0)
> 
> and $0 expands to ['12','34','56','78','90'] if you treat it as an array.

Exactly so.  Principle of least surprise wins again! ;)

-Scott
-- 
Jonathan Scott Duff
duff@pobox.com

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About