I have a script that uses if elsif else repeatedly.
Basically its like this
if ($answer eq "y"
{
do something here;
}
elsif ($answer eq "n"
{
print "bye \n";
exit;
}
else {
print "skipping\n";
}
I want a user to answer the question and if yes do some code. If no exit and any other answer skip to the next itereation of an if elsif else.
Is there an easier way? How can I exit and kill the entire script if chosen "n". The way it is now if a user chooses n then it just skips. I think its something to do with my looping but I'm just lost.
TIA
Info
Basically its like this
if ($answer eq "y"

do something here;
}
elsif ($answer eq "n"

print "bye \n";
exit;
}
else {
print "skipping\n";
}
I want a user to answer the question and if yes do some code. If no exit and any other answer skip to the next itereation of an if elsif else.
Is there an easier way? How can I exit and kill the entire script if chosen "n". The way it is now if a user chooses n then it just skips. I think its something to do with my looping but I'm just lost.
TIA
Info