in reply to Why does assignment change the result?

I think what demerphq said could use some clarification.

You are calling the two subs in scalar context, due to the fact that the results are being immediately subjected to the dot operator (string concatenation). So you need to understand what the return expression (or, lacking that, the last expression evaluated) in each sub will do when evaluated in scalar context.

@_ in scalar context results in the length of the array, which in this case is the integer 2. It doesn't even matter what the contents of the array are.

@_[0,1] in scalar context results in the last value in that list. This is because @_[0,1] is a list expression, not an array. And all lists, or listy things, evaluate to their last value when in scalar context. In this case, that value is the string 'two'.

You should try altering your little program to call those subs in list context, to see what happens. (It's probably what you expected in the first place.) The easiest and best way to do this is to replace those dots with commas, like so:

print "two easy: ", two_easy( 'one', 'two' ), "\n"; print "two hard: ", two_hard( 'one', 'two' ), "\n";
Remember that print takes an unlimited list of arguments, and they're all evaluated in list context. (But the dot operator has higher precedence than the comma.)

A word spoken in Mind will reach its own level, in the objective world, by its own weight