print "Do you want to run live tests (y/n)? "; my $answer = ; # beware of trailing newlines if ($answer =~ /^n/i) { $foo = 0 } elsif ($answer =~ /^y/i { $foo = 1 } else { $foo = $default_foo } # default