Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Anonymous Arrays or Anonymous Array References

by Fletch (Chancellor)
on Mar 03, 2011 at 15:35 UTC ( #891244=note: print w/ replies, xml ) Need Help??


in reply to Anonymous Arrays or Anonymous Array References

The first would work if you provided an extra set of parens or unary plus to make it parse the way you intended it to in light of the optional paren behavior.

$ perl -MO=Deparse,-q,-p -e 'print +(1,2,3)[1];' print(((1, 2, 3))[1]); -e syntax OK $ perl -MO=Deparse,-q,-p -e 'print( (1,2,3)[1] );' print(((1, 2, 3))[1]); -e syntax OK

The cake is a lie.
The cake is a lie.
The cake is a lie.


Comment on Re: Anonymous Arrays or Anonymous Array References
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (17)
As of 2015-07-30 15:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (272 votes), past polls