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

RE: Ballsy coding

by Anonymous Monk
on Apr 20, 2000 at 20:44 UTC ( [id://8191]=note: print w/replies, xml ) Need Help??


in reply to Ballsy coding
in thread "Ate My Balls" Syntax Generator

Whoops, I'm new here and didn't realize comments were html-ized. That line of code should read:

print "@groups[rand($#groups + 1)]\n";

That is all.

Replies are listed 'Best First'.
RE: RE: Ballsy coding
by chromatic (Archbishop) on Apr 20, 2000 at 20:59 UTC
    Hmm, even shorter to say: print $groups[rand(@groups)], "\n"; Did the OP mean to take an array slice?
RE: RE: Ballsy coding
by Anonymous Monk on Apr 20, 2000 at 20:46 UTC

    Or rather:

    print "@groups[rand($#groups + 1)]\n";

    Phew, a "preview post" button would've helped though...

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2024-04-18 21:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found