in reply to Using If/Else
print "Your time is almost out make a choice either 1 for Vampire or 2 + for Werewolf. \n"; chomp ($choice=<STDIN>) ; if ($choice== 1) {vamp() ; } if ($choice== 2) {wolf() ; } sub vamp {print "Congratulations $name on choosing to become a vampire +. I will turn you as requested and be your mentor until I deem you ready to go out o +n your own. \n"; } sub wolf {print "Congratulations $name on choosing to become a werewol +f. I will turn you as requested and introduce you to my pack where you will learn of +your new skills. \n"; }
|
|---|