in reply to Re: redeclaring variables with 'my'
in thread redeclaring variables with 'my'
my $x='ok'; # scads of code my $x=300; while ($x--) { do_something_with($x); } # scads of code... print "$final" if ($x eq 'ok'); #kaboom
In the end, when you do a "-w" and it complains that '$x won't stay shared' or something at the second my, your lesser perl wizard is likely to take the "my" off since the variable is already declared. Ouch.
In the end, you suffer the cost of extra work on the backside to protect yourself from the future.
--
$you = new YOU;
honk() if $you->love(perl)
|
|---|