is this a duplicate question? Then please delete it and refund the points ;-)
Main Topics
Browse All TopicsThis is the code to get a y/n but when I make a subsequent call it does not ask for the input !
#! /in/local/bin/perl
sub demande {
my $in=0;
system("echo \"Have u modified \"");
$in = lc(getc);
$in =~ s/ //ge;
$in =~ s/\n//ge;
if ($in ne "y")
{
system("echo \"U are out NO BOSS .... $in\"");
exit;
}
else
{
system("echo \"U are in YES BOSS .... $in\"");
}
}
#end od demande
########MAIN#########
demande();
demande();
thanks
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
anil27,
"..thanks maneshar. I was looking for output buffering parameter |++....."
You're welcome. Glad to know you got the solution you were looking for.
Meanwhile, please go ahead and delete the duplicate question that you have posted.
http://www.experts-exchang
Business Accounts
Answer for Membership
by: maneshrPosted on 2002-04-25 at 09:18:37ID: 6969078
anil27,
".. code to get a y/n but when I make a subsequent call it does not ask for the input !..."
What exactly are you trying to do? Can you explain in plain english what you are trying to acheive?
Let me know.
This will help you get a more accurate answer, faster.
Meanwhile, here is a sample script that will be run from the command prompt.
This script will ask the user for input.
If input is Y or y, then it will print a "YES" message.
If input is N or n, then it will print a "NO" message.
if input is anything else it will print a "INVALID" message.
#!/in/local/bin/perl
$|++; ## Disable output buffering
print "Enter your reply ";
$ans=<STDIN>; ## Read the users input
## Remove the newline character
chomp($ans);
if ($ans=~ /^y$/i){ ## Y or y entered!!
print "YES\n";
}elsif ($ans=~ /^n$/i){ ## N or n entered!!
print "NO\n";
}else{
print "INVALID\n";
}