foreach(sort keys %switches) { ${$_}= "$switches{$_}"; if ($D) { print " * \$$_ is switched \"$switches{$_}\""; if ($switches{$_} eq '1') { print " (ON)"; } if ($switches{$_} eq '0') { print " (OFF)"; } print "\n"; } }