my %running = ( foo => 1, bar => 1, baz => 1 ); if ($running{'foo'} == 1) { # do stuff } # foo has finished: delete $running('foo'}