I am rewriting a shell script into perl and I need to
know how to place a timeout function into the script.
Basically I have this
print "Now we will begin the tests, do you wish to continue (y/n)";
chop ($answer = <STDIN>);
if ($answer = "yes"
{
print "We will continue";
}
DO SOME STUFF HERE
if ($answer = "no"
{
die "bye bye"
}
Basically I need to put a timeout that defaults to yes in order to DO SOME STUFF HERE. Can this be done in perl without creating a seperate file???
I was thinking of a new format using the if/else/elsif but I really am not sure of the best way.
TIA
Info
know how to place a timeout function into the script.
Basically I have this
print "Now we will begin the tests, do you wish to continue (y/n)";
chop ($answer = <STDIN>);
if ($answer = "yes"
print "We will continue";
}
DO SOME STUFF HERE
if ($answer = "no"
die "bye bye"
}
Basically I need to put a timeout that defaults to yes in order to DO SOME STUFF HERE. Can this be done in perl without creating a seperate file???
I was thinking of a new format using the if/else/elsif but I really am not sure of the best way.
TIA
Info