$ ./numbers.pl#!/usr/bin/perl sub RandomiseArray { my (%b, $c); map { do { $c = rand } until(!exists $b{$c}); $b{$c} = $_ } @_ +; return values(%b); } my @a = RandomiseArray(1..10); print "@a\n";
In reply to Re: How can I print all the numbers from 1 to n in random order?
by lanval
in thread How can I print all the numbers from 1 to n in random order?
by vroom
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |