my $r = undef; my %codes = ( hour => sub{ $r = $notifytable_hour }, hfhour => sub{ $r = $notifytable_hour << 1 + ( $notifytable_min > 29 ? 1 : 0 ) }, qhour => sub{ $r = $notifytable_hour << 2 + floor( $notifytable_min/15 ) }, minute => sub{ $r = $notifytable_min }, 0 => sub{ $r = $notifytable_min }, ); $codes->{$rdg}->() if($codes->{$rdg}) ;