in reply to set context for method's return values
Yields:print(split(",", "A,B,C,D")[2]);
I think what you want is:syntax error at XXX.pl line YYY, near ")["
print can take a file handle as an optional arg and this can be confusing.print "",(split(",", "A,B,C,D"))[2];
Basically don't put a Perl variable or a function call immediately after the keyword "print". Adding more parens is a possible solution, but I prefer the above. Mileage varies.
|
|---|