http://www.perlmonks.org?node_id=596454


in reply to A Case with 5 Var's

If restructuring your code to use a hash is too awkward, you can assign you vars to an array and quickly check that - e.g. (untested)

$var1 = 'hello'; $var2 = 0; $var3 = ''; @array = ($var1, $var2, $var3); foreach(@array){ print "empty\n" if $_ eq ''; }
map{$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
Tom Melly, pm@tomandlu.co.uk