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.
|
---|
In Section
Seekers of Perl Wisdom