use Term::ReadLine; # Initialize the term variable for the keyborad input my $TERM = new Term::ReadLine 'Installer'; my $OUT = $TERM->OUT || \*STDOUT; my $prompt = "Would you like to continue\n"; my $ans; $ans = ($TERM->readline($prompt)) ? : 'yes' : ; chomp($ans); print "ans is $ans \n"; if($ans =~ /yes/) { print "yes and continue\n"; } else { print "no and take action\n"; }