It's hard to look outside the box, almost by definition. So what follows aren't really suggestions for syntax, they're more questions for "what's a good idiom for?"
The "loop-and-a-half" problem has already been mentioned, but I still haven't seen anything that looks really good (though the redo aproach may be the cleanest).
Something I've frequently found myself doing is wanting a three-way control structure for greater than, less than, and equal to. Sure there are ways to do it, but none of them really feel clean.
given fork {
case $_ < 0 {
#error
}
case $_ > 0 {
#parent
}
default {
#child
}
}
or
if ((my $pid = fork()) < 0){
#error
} elsif ($pid > 0) {
#parent
} else {
$child
}
But it's the sort of thing that feels like it could be simpler. A better example might be checking two values against each other, where it feels unnatural to need a separate variable or compare them multiple times.
if (get_the_boundary_x() < the_user_provided_x()){
draw_color("green");
elsif (get_the_boundary_x() == the_user_provided_x()){
draw_color("blue");
else {
draw_color("red");
}
(Yes, I know that can be done with
draw_color(qw( blue red green )[get_the_boundary_x() <=> the_user_provided_x()], but that's just ugly and confusing).
merlyn's looking for a good idiom: return this if this is true shows another question without a (really good, or at least completely natural) answer. The suggested if (my $ret = thatroutine()){return $ret} feels ugly due to the synthetic variable $ret.