Beefy Boxes and Bandwidth Generously Provided by pair Networks RobOMonk
Just another Perl shrine
 
PerlMonks  

Re: Getting single element from an array

by choroba (Abbot)
on Nov 01, 2012 at 09:20 UTC ( #1001785=note: print w/ replies, xml ) Need Help??


in reply to Getting single element from an array

The ( in the second case is taken by the parser as starting the argument list. When the [ is being parsed, it is already too late to change mind. You can use + to disambiguate:

print +("adf","ff","f")[1];
لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ


Comment on Re: Getting single element from an array
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (8)
As of 2014-04-18 06:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (462 votes), past polls