in reply to Re: Passing Reference of a Hash to a method
in thread Passing Reference of a Hash to a method
Er... no. If the original poster was assigning a list to a scalar, then the behaviour of the comma operator would ensure that he ended up with the last element in the list in the scalar variable - which would have been what he wanted.
my $scalar = ('this', 'is', 'a', 'list'); print $scalar; # prints 'list'
The problem was caused because he was assigning an array, not a list.
Please read What is the difference between a list and an array? from perlfaq4 which explains this difference in more detail.
"The first rule of Perl club is you do not talk about
Perl club."
-- Chip Salzenberg
|
|---|