http://www.perlmonks.org?node_id=1001781

gurpreetsingh13 has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

Was just trying some statements and wondered why a similar one doesn't work.
print ("adf","ff","f"); # Gladly prints the list print ("adf","ff","f")[1]; #Gives a syntax error $val=("adf","ff","f")[1];print $val; #Works easily print join "",("adf","ff","f"); #Works print join "",("adf","ff","f")[1]; #Works since treated in list contex +t
I might be wrong on some basics. But why the 2nd statement fails. I mean if such a thing works, then we can directly use it to print a single element returned from a function or method(like in Java).e.g.
(sort {$a<=>} @lst)[0] # an alternative way to get min value from some + numeric list.
Similarly in Java we can do:
obj.method()[2] #when we know that method returns an array

Tried to search a little about this, but could not find a reasonable thread for the same. Sorry again if this is some conceptual weakness of mine.