in reply to Re: A missleading sub
in thread Trouble with flow control

I've fixed all the problems that I can see but it still throws me the wrong way. Now what ever I enter in the confirm sub activates the else tag of the if statement. And sends me back to confirm()!!! Heres what I've done: (I ran it with warnings on.)
#To determine the pattern of fish reproducing #in a pond start(); sub start{ print "Welcome to the 'Fish in a Pond' chaos theory solution guide +.\n" . "Please enter the number of fish in the pond on the f +irst year:\n"; print "\n"; $nof = <STDIN>; print "\n"; print "Please enter the anual rate of increase: \n"; print "\n"; $roi = <STDIN>; print "\n"; print "For what period of time would you like the simulation t +o run for(in years): \n"; print "\n"; $yrs = <STDIN>; chomp($nof); chomp($roi); chomp($yrs); $confirm = confirm(); if ($confirm eq 'n') { start(); } elsif($confirm eq 'y') { middle(); } else{ print "Please enter either Y or N. \n"; confirm(); } } sub middle{ $ans = $nof; $year = 0; print "Year $year. = $ans fish."; print "\n"; calc(); } sub calc{ while($year <= $yrs) { $year = $year + 1; $i = $ans * $roi; $x = 1 - $ans; $ans = $i * $x; print "Year $year. = $ans fish. \n "; } } sub confirm{ print "The data that you have entered says: \n" . " * that there is $nof thousand fish in the pond on the fisrt +year.\n" . " * that the annual rate of increase is $roi. \n" . + " * that the simulation will run for $yrs years. \n\n"; print "Is this information correct?(Y/N): "; $answer = <STDIN>; $answer =lc($answer); return($answer); }
Help please.
All the Best, Eoin...

If everything seems to be going well, you obviously don't know what the hell is going on.