Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Redirecting"enter" when an external command is running..

by PeterPeiGuo (Hermit)
on Dec 04, 2010 at 22:22 UTC ( [id://875420] : note . print w/replies, xml ) Need Help??


in reply to Redirecting"enter" when an external command is running..

Change == to eq. But apparently you did show the relevant code here.

Peter (Guo) Pei

  • Comment on Re: Redirecting"enter" when an external command is running..

Replies are listed 'Best First'.
Re^2: Redirecting"enter" when an external command is running..
by perl_mystery (Beadle) on Dec 04, 2010 at 22:33 UTC

    That's not what I want.If i change == to eq,the variable $choice still picks up the "enter",while the script is running ,any "enter" buttons should be redirected so that the $choice variable doesn't pick it.

      Change line 1 from print "Running Script....\n";

      to print "Running Script: <big><b>Do NOT hit enter!</b></big>\n"; perhaps ?

            :-)

        I changed the order of the program execution to resolve this problem but i have one more question now...I am doing a check on $choice for value 1 or 2 ,if not print "INVALID CHOICE" and then exit the program.Is there a way to ask the user to re-enter the choice rather than exiting the program?

        print "\nEnter your choice: "; my $choice = <>; chomp ($choice); if($choice != (1||2)){ print "/*******************************************************/\n +"; print "INVALID CHOICE\n"; print "/*******************************************************/\n +"; exit; }