Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: random variable declaration based on given count

by Bloodnok (Vicar)
on Mar 26, 2014 at 11:30 UTC ( #1079807=note: print w/replies, xml ) Need Help??


in reply to random variable declaration based on given count

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 :-))

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1079807]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2022-05-25 20:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (90 votes). Check out past polls.

    Notices?