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

Don't you mean:

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

Replies are listed 'Best First'.
Re^3: Pass by Value does not work
by Marshall (Canon) on Feb 23, 2009 at 00:02 UTC
    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.

      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