# File: yesorno.pl # Title: Use subroutine greetings() # Do this until you want to. Continue(y/n)? = # Author: Mihaela Malita # Hello! # Continue(y/n)?= y # Hello! # Continue(y/n)?= n # Bye $yesorno = "y"; while ($yesorno eq "y") { greetings(); # invoke subroutine greetings() print "\nContinue(y/n)?= "; $yesorno = ; chop($yesorno); } print "Bye"; exit; sub greetings { print "Hello!\n"; return; }