#!/usr/bin/perl my $count = 0;my %dict = ();while (scalar keys %dict < 10) { $dict{int(rand(10))} = 1; $count ++;} print $count;
Standard input is empty
16
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!