while ( 4 == scalar grep {$_ = ; chomp} my($name,$address,$phone,$fax) ) { # Do stuff }