in reply to While loop does not terminate

Instead of logging where you are, consider also logging the values that contribute to the loop condition:

while (($status = gv() eq 'initializing')) { print "stuck in loop with status [$status], waiting for 'initializin +g'\n"; }

Maybe it is initialising, or there is whitespace at the end...