Code:
ALLOK: { print "\nWelcome Logan!\n\n";
YORN:
print "If you wish to proceed\npress (Y) otherwise press (N): ";
$input = <STDIN>;
chomp($input);
$input=~ tr/A-Z/a-z/;
if($input eq 'n') {
print "\nSorry, mabye next time :)\n\n";
sleep(3);
exit;
}
unless ($input eq 'y') {
print "\nYou must press Y or N, not $input\n\n";
sleep(2);
goto YORN;
}
if($input eq 'y') {
print "\n\nWelcome Logan!!!";
sleep(3); #HERE IS THE PROBLEM...I THINK
exit;
}
}
what i want this to do, is when the user presses "Y" it prints "Welcome Logan!" and waits 3 seconds and then, naturally, exits...what happens though, is it pauses BEFORE it prints "Welcome Logan"... i have tried reversing where the sleep is, and adding an additional sleep above the Print line..but it does the Sleep command first, then prints...i cant figure out why...any help is appreciated

