#!usr/bin/perl use strict; use warnings; my $line; while ($line = and $line !~ /^\s*$/) { print "do somehing with non blank line\n"; } __END__ Value of construct can be "0"; test with defined() at C:\Users\mmtho\Documents\PerlProjects\Monks\test_myVar_inwhile_ver2.pl line 7. do somehing with non blank line do somehing with non blank line