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

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

Thread Previous | Thread Next
From:
Autrijus Tang
Date:
May 12, 2005 13:05
Subject:
Re: split /(..)*/, 1234567890
Message ID:
20050512200523.GA46876@aut.dyndns.org
On Thu, May 12, 2005 at 02:56:37PM -0500, Jonathan Scott Duff wrote:
> On Thu, May 12, 2005 at 12:01:59PM -0700, Larry Wall wrote:
> > 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! ;)

Thanks, implemented as such.

    pugs> map { ref $_ } split /(..)*/, 1234567890
    (::Str, ::Array::Const)

Thanks,
/Autrijus/

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