Many thanks$my number =10; while($input=<STDIN>){ print"choose 1 or 2 \n"; $choice=(<STDIN>); if($choice=~/1/){ &flashcard(); else{ $choice=~/2/); print"enter random range\n"; my $newrandom = (<STDIN>); &options($newrandom); } } sub flashcard { my $random = int(rand(&options())); } sub options { my $max = shift; if ($max==10){ return 10; }else{ return $max; } }
In reply to Re-assign value to subroutine by props
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |