Syntactic Confectionery Delight | |
PerlMonks |
Re: random variable declaration based on given countby Bloodnok (Vicar) |
on Mar 26, 2014 at 11:30 UTC ( [id://1079807]=note: print w/replies, xml ) | Need Help?? |
rand would seem to be your friend e.g. sub get_val { my $n = int(rand(shift())); return "var$n" } - added to which, I would question the naming of the sub - given that it is attempting to return a var name c/w a val ?
A user level that continues to overstate my experience :-))
In Section
Seekers of Perl Wisdom
|
|