$|++; # make sure we turn off buffering. print "Is the rock blue? yes or no: "; my $response = ; chomp $response; # get rid of the enter key if ($response eq 'yes') { print "Great, it's blue!\n"; } elsif ($response eq 'no') { print "Hmm - that stinks. You need a blue rock.\n"; } else { print "yes or no, boy!\n"; }