perl -e'$_=q#: 13_2: 12/"{>: 8_4) (_4: 6/2"-2; 3;-2"\2: 5/7\_/\7: 12m m::#;s#:#\n#g;s#(\D)(\d+)#$1x$2#ge;print'#!/usr/bin/perl -l use strict; my @a = 1..15; my ($tmp, %h); while (keys %h < 5){ $tmp = $a[rand @a]; $h{$tmp}++ unless $h{$tmp}; } print for keys %h;
In reply to Re: random elements from array - new twist
by pizza_milkshake
in thread random elements from array - new twist
by felwick
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |