my $tp = new IO::File "Sharmen", "w"; $tp->wipe(); if($bathroom) { SWITCH: { $bathroom eq "dark" && do { &lights('on');}; $bathroom eq "stinky" && do { &fan('on');}; $bathroom eq "leaving" && do { &lights('off');}; DEFAULT: { &lights('off') && &fan('off'); }; }