my %do_for = ( get_hosts => GetHosts($_, \%data), get_new_fw_rules => GetNewFWRules($_, \%data), ); #print "while\n"; if ( ! $do_for{$what_to_do} ) { warn "ERR - what to do $what_to_do"; };