local $_; do { do { print "> "; chomp( $_= ); } until( /\S/ ); } until( 'FALSE' eq cmd_select( split ' ' ) ); #### local $_; do { print "> "; chomp( $_= ); } until( /\S/ && 'FALSE' eq cmd_select( split ' ' ) ); #### local $_; do { do { print "> "; defined( $_= ) or die "EOF on STDIN"; chomp( $_ ); } until( /\S/ ); } until( 'FALSE' eq cmd_select( split ' ' ) ); #### lots of work to get next thing; # possibly giving up for any of several reasons goto TOP if thing isn't interesting; if( thing is invalid ) { instruct; goto TOP; } do lots of stuff with thing; goto TOP if not last thing; if( no valid things found ) { complain; return; } finish up; return result; #### sub get_next_interesting_thing { do { return if ! get_next_thing; } until( interesting_thing ); return thing; } sub get_next_valid_thing { while( get_next_interesting_thing ) { return thing if valid_thing; instruct; } return; } if( ! get_next_valid_thing ) { complain; return; } do { do lots of stuff with thing; } while( get_next_valid_thing ); finish up; return result;