in reply to Re: Split returning one element
in thread Split returning one element

Can you elaborate on what is going on with the + sign?

Replies are listed 'Best First'.
Re^3: Split returning one element
by moritz (Cardinal) on Nov 05, 2009 at 18:50 UTC
    thing (...) parses a function call, leaving out the + would mean the whole statement is parsed as
    ( print(split ...) )[0]

    Which is not what you want.

    Perl 6 - links to (nearly) everything that is Perl 6.
Re^3: Split returning one element
by ikegami (Patriarch) on Nov 05, 2009 at 20:39 UTC
    print +(split /\./, 'www.google.com', 2)[0];
    is a weird way of writing
    print( (split /\./, 'www.google.com', 2)[0] );