Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
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 avoiding work at the Monastery: (8)
As of 2014-09-18 08:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (109 votes), past polls