![]() |
|
Do you know where your variables are? | |
PerlMonks |
Re^2: Assign multiple scalars the same valueby diotalevi (Canon) |
on Jan 24, 2005 at 22:55 UTC ( #424730=note: print w/replies, xml ) | Need Help?? |
This solution is less good than simply assigning the value to each variable separately in my $a = my $b = my $c = 'TRUE' because it avoids having to count how many variables you have. In your code, if you got the number wrong then the trailing variables will be left undefined which is far and away from the intent to leave them with a true value. You're making it easy to write in a bug later.
In Section
Seekers of Perl Wisdom
|
|