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 ( [id://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?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2024-04-24 03:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found