http://qs321.pair.com?node_id=1148455


in reply to do-until inside while loop control

Check out the redo command, which allows you to go back to the top of a loop without re-evaluating the conditional (in your case, without reading another line in while (<data_file>)) so $_ will still contain the line with regex2 in it.