The right-hand side of an assignment is always evaluated before the left-hand side. (This is what allows for chained assignments, like $x = @y = 7.) In your first snippet, you create a reference to an array, then shift the first value off the same array. In the second snippet, however, you create a new array with the first three elements of the original array, and then shift the first value off the
old array.
I think this situation is not best handled with a single line of code:
my $key = shift @array;
$test{$key} = [ @array[0,1,2] ];
BTW,
\@{ [ LIST ] } creates a reference to an anonymous array, dereferences the reference to the anonymous array, and then creates a new reference to the anonymous array. That's a bit silly... :)