foreach $key (sort (keys(%myHash))) { ... if (condition) { # Start over without advancing. # $key retains its current value. redo; } ... }