for ($var) { /test/i && do { # stuff here last; }; do { # nice default last; # not really needed here .. But what the hey :) }; }