On Jan 17, 2008 2:55 PM, Hrvoje Niksic <[EMAIL PROTECTED]> wrote:
>
> @$ref = (4, 5, 6) intentionally assigns to the same list pointed to by
> the reference. That would be spelled as x[:] = [4, 5, 6] in Python.
> What Python does in your example is assign the same as Perl's $ref =
> [4, 5, 6]. So they're not so different after all.
>
Yup,you're so right.This test below in perl is the same as in python.
So at before I may got mistaken by myself.Thanks all.
$ cat t1.pl
sub test {
my $ref = shift;
$ref = [4,5,6];
}
my @a = (1,2,3);
test([EMAIL PROTECTED]);
print "@a";
$ perl t1.pl
1 2 3
--
http://mail.python.org/mailman/listinfo/python-list