Sorry, I can't reproduce this; if get_value() returns 'initializing', then the loop terminates immediately.
use warnings; use strict; my $cnt; sub get_value { $cnt++ < 10 ? 'initializing' : 'ok' } my $status; while( !( ($status = get_value()) eq 'initializing' ) ) { print "X" } print "Y\n";
Just prints one Y.
Edit: This was posted before the root node was updated, see my reply here.
In reply to Re: While loop does not terminate
by haukex
in thread While loop does not terminate
by nysus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |