in reply to Re: Avoiding Global Vars
in thread Avoiding Global Vars
Thanks all - and apols for the wrong terminology (i.e. global <> "my", just because "my" outside of a block is lexical to the whole file)
One point to clarify is that the reason it bugs me, apart from wanting vars to only live within the scope where they are needed, is that I might re-use the name $vrx later, with possible side-effects.
bv's suggestion (use a bare-block) seems the most economical and least confusing, but I will also bear in mind that I shouldn't sweat the details....
Tom Melly, pm (at) cursingmaggot (stop) co (stop) ukmap{$a=1-$_/10;map{$d=$a;$e=$b=$_/20-2;map{($d,$e)=(2*$d*$e+$a,$e**2 -$d**2+$b);$c=$d**2+$e**2>4?$d=8:_}1..50;print$c}0..59;print$/}0..20
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Avoiding Global Vars
by dsheroh (Monsignor) on Sep 23, 2009 at 14:03 UTC | |
by Melly (Chaplain) on Sep 23, 2009 at 15:29 UTC | |
Re^3: Avoiding Global Vars
by ikegami (Patriarch) on Sep 23, 2009 at 19:56 UTC |