use strict; use warnings; my $str = ""; #while (defined($str)) {#caution: this is different from what sauoq had, as this is not an assignment from <> #while ($str) { print "inside while loop\n"; }