in reply to Re^3: print question
in thread print question

Your question is yet another example where using strict and warnings makes things a whole lot easier to understand:
print ("a", "b")[1]; print qw(a, b)[1]; __END__ # Result: syntax error at x.pl line 3, near ")[" Execution of x.pl aborted due to compilation errors.

But when you add those 2 magic lines at the top:

use strict; use warnings; print ("a", "b")[1]; print qw(a, b)[1]; __END__ print (...) interpreted as function at x.pl line 5. Possible attempt to separate words with commas at x.pl line 6. syntax error at prog.pl line 5, near ")[" Execution of x.pl aborted due to compilation errors.

That line about "print (...) interpreted as function ..." is what others (eg. mreece and jdporter) have already discussed.

Another way of looking at it is that:

print ("a", "b")[1];

is the same, precedence-wise, as:

(print ("a", "b"))[1];

which doesn't make sense (ie. is a syntax error).  You have to force the desired precedence with:

print (("a", "b")[1]);

The line "Possible attempt to separate words with commas" is just alerting you to the fact that instead of:

print qw(a, b)[1];

you probably actually meant something more like:

print qw(a b)[1];

s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/