push @num, splice(@array, int rand @array, 1); #### #!/usr/bin/perl -w use strict; my $counter = "0"; my $randstring; my @testarray = ( 'a' .. 'z', 'A' .. 'Z', '0' .. '9' ); do { $randstring .= splice(@testarray, int rand @testarray,1); ++$counter; } until $counter == 62; print "\n\$randstring: $randstring\n\n";