Is the following a reasonable procedure to randomly display all the contents of an array without repetition of the array's contents?
#!/usr/bin/perl -w use strict; my @chars = ( 'A' .. 'Z' ); for (0 .. $#chars){ my $randomIndex = rand( @chars ); print "\n$chars[$randomIndex]"; splice( @chars, $randomIndex, 1 ); } exit;
In reply to Random but non-repeating array loop by ckohl1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |