in reply to Re^2: Pass by Value does not work
in thread Pass by Value does not work

I think we were both a little wrong..ooops..

 my @xx_clone = map { [ @$_ ] } @xx;

looks like that's better.. Thanks!!!.. UpdateI corrected post above. Thanks again. In general the {} are only needed when subscripts are involved. Another situation is say: @list = @{listref_returning_fun()};

In above posts, to get array back, my @lol = @{left_triangle(@xx)}; The above posts return reference to lists of lists. to get the LOL back, deference one time using @X= @{subroutine()} syntax.

Replies are listed 'Best First'.
Re^4: Pass by Value does not work
by gwadej (Chaplain) on Feb 24, 2009 at 14:21 UTC

    Although the {} are not necessary, I always use the {} when derefencing a reference and the -> when dereferencing an element.

    That approach has always seemed clearer to me.

    But, TMTOWTDI always in Perl.

    G. Wade