Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: random negative toggle function

by !1 (Hermit)
on Nov 15, 2003 at 19:37 UTC ( [id://307366]=note: print w/replies, xml ) Need Help??


in reply to random negative toggle function

As another way to do it:

perl -le'print +(-1,1)[rand 2]' # or as a sub sub toggle { (-1,1)[rand 2] }

Of course, that's the short and simple way. I hope this helps you with your problem.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (4)
As of 2024-04-19 03:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found