On Fri, 18 Jan 2002, [iso-8859-1] amrit kumar wrote:
> hi,
>
> what i want to proove is...supposer that i assign an
> array @a = (1,2); and then i define another array @b
> which is equal to @a.I have to proove that this is
> done by assigning a copy of array @a to @b rather than
> by reference.
>
> Can you help me do that...i am bit confused ..
>
To use your example:
my @a = (1, 2);
my @b = @a;
print "a: @a\n";
print "b: @b\n";
$b[1] = 'foo';
print "a: @a\n";
print "b: @b\n";
run those lines of code, and you will see that altering @b, doesn't
alter @a.
Christopher
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]