in reply to trying to get a loop to redo

Once the messages cease I would like my script to continue.

Simple. Do something like

while ( <STDIN> ) { chomp($input = $_); if ( $input =~ /^okay\b/i ) { print "Y" } } # script continues here when STDIN is exhausted