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


in reply to Re: variable declaration question
in thread variable declaration question

print(my $foo = (1, 2, 3), "\n"); print(my ($foo) = (1, 2, 3), "\n"); __END__ 3 1

Ah, I see. The line:

print(my $foo = (1, 2, 3), "\n");

is a convenient way of assigning the last element of an array to a variable.