use strict; use warnings; while (1) { my $foo = ; $foo =~ m/./ and print "success.\n"; # ... (more code) ... }