perl -MO=Deparse,-p -e "$a = $_ + rand @{$r} - $_" ($a = ($_ + rand((@{$r;} - $_)))); ^^ ^^ -e syntax OK
The '- $_' is part of the argument to rand, not the assignment to $a.
In reply to Re: Re: Re: random elements from array - new twist
by jsprat
in thread random elements from array - new twist
by felwick
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |