in reply to Re: Re: Re: Action at a great distance
in thread Action at a great distance
bracket happy? :)No, actually... by saying @{ \@list }, you're just referrencing and dereferrencing the same list. In order to make an inline copy of the list, you'd need to add back in there a second, new (anonymous) array.$->( @{ \@args } );
Please... if you're going to "correct" someone, then make sure that you are correct and that (s)he is incorrect.[me@host]$ perl -le 'sub foo { $_[0]++ } @x = (0,1); foo(@x); print "@ +x"' 1 1 [me@host]$ perl -le 'sub foo { $_[0]++ } @x = (0,1); foo(@{ \@x }); pr +int "@x"' 1 1 [me@host]$ perl -le 'sub foo { $_[0]++ } @x = (0,1); foo(@{[ @x ]}); p +rint "@x"' 0 1 [me@host]$
------------ :Wq Not an editor command: Wq
|
|---|