@a = (10, 2, 3, 5, 89); @b = (2, 5); my $c = []; foreach (@a) { $c[$_] = $_; }; foreach (@b) { $c[$_] = undef; } foreach (0 .. $#{@c}) { print "$c[$_]\n" if (defined($c[$_])); }
In reply to Re: Choosing a random product from an Array
by pg
in thread Choosing a random product from an Array
by krisraman
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |