Kaushal Shriyan wrote:

Thanks Rob

All they're saying is that $a = $b doesn't tie $a and $b together in any way, it just copies the value of $b to $a. If you change $b after that it won't alter $a again.

Can you please explain me with a sample code. If I understand it correctly does the below code holds true for your explanation

#!/usr/bin/perl -w
$b = 2;
$a = $b;
print "$a\n";
$b = 4;
$c = $b;
print "$c\n";

Something like that. How about:

$b = 2;
$a = $b;
print "$a $b\n"; # Now $a has the same value as $b

$b = 4;
print "$a $b\n"; # $b has changed but $a stays the same


Rob

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to