while ( my $foo = get_next_foo() ) { if ( $foo == 1 ) { next; } do_some_stuff(); } continue { # Everything ends up here whether 'next' was hit or not do_some_more_stuff(); }