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.
In reply to Re: random negative toggle function
by !1
in thread random negative toggle function
by zentara
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |