props has asked for the wisdom of the Perl Monks concerning the following question:
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; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re-assign value to subroutine
by ysth (Canon) on Nov 19, 2007 at 22:38 UTC | |
by props (Hermit) on Nov 19, 2007 at 23:04 UTC | |
|
Re: Re-assign value to subroutine
by swampyankee (Parson) on Nov 19, 2007 at 23:09 UTC | |
|
Re: Re-assign value to subroutine
by ikegami (Patriarch) on Nov 19, 2007 at 22:36 UTC |