perl_mystery has asked for the wisdom of the Perl Monks concerning the following question:

print "Running Script....\n"; my @scriptlog =`perlscript -b -f=$file`;#when this command is running +,if the user presents enters the choice picks it up,how to redirect o +r stop this? print "\nEnter your choice: "; my $choice = <>; chomp($choice);

When the above command "perlscript"is running,when the user presses "enter".I get the following error.Can someone pls suggest how to overcome this?

Argument "" isn't numeric in numeric eq (==) at Blacklisted_ErrorCRs.pl

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

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

    Peter (Guo) Pei

      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 ?

              :-)