print ("a", "b")[1];
does not work, you need an extra pair of ():
print (("a", "b")[1]);
but
print qw(a, b)[1];
works fine without ().
The book I am reading(http://www.perl.org/books/beginning-perl/) says print has higher precedence than 1. But this does not work in the second example with "qw" so I am confused.
In reply to Re: print question
by Anonymous Monk
in thread print question
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |