Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re: Confused by '+' syntax in code sample.

by space_monk (Chaplain)
on Jun 26, 2013 at 05:56 UTC ( #1040704=note: print w/ replies, xml ) Need Help??

in reply to Confused by '+' syntax in code sample.

It is to prevent say interpreting the parenthesised expression as its function arguments, at least not before only using the first element of the array returned from split instead of the entire array.

It doesn't really "do" anything except assist how Perl interprets the expression.

# say would think that its arguments are the whole statement in bracke +ts say +(split ':')[0] while (<DATA>); we use the + to make it clear that the contents of the brackets +are not function arguments # but part of an expression say +(split ':')[0] while (<DATA>);
If you spot any bugs in my solutions, it's because I've deliberately left them in as an exercise for the reader! :-)

Comment on Re: Confused by '+' syntax in code sample.
Select or Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1040704]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2015-11-25 06:12 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (671 votes), past polls