for (keys %$schedule) { delete $schedule->{$_} if exists $completed{$schedule->{$_}{Course}}; }