I found these two lines from Perl Cookbook which does what I want.
@chars = ( "A" .. "Z", "a" .. "z", 0 .. 9, qw(! @ $ % ^ & *) );
$password = join("", @chars[ map { rand @chars } ( 1 .. 8 ) ]);
Thanks to Stan Francis and Otto, Doug who send me a link and his code.
Cedric
http://www.metronet.com/1/perlinfo/scripts/
#!/opt/perl/bin/perl
$word_file = "/usr/dict/words.6";
$delimiter = "\n";
open (FILE,"$word_file");
@FILE = <FILE>;
close(FILE);
$chunks = join('',@FILE);
@chunks = split(/$delimiter/,$chunks);
srand(time);
$choice1 = rand(@chunks);
$number1 = rand(10);
$number2 = rand(10);
$digit1 = substr($number1,3,1);
$digit2 = substr($number2,3,1);
print "\n";
print substr($chunks[$choice1],0,6);
print substr("0123456789",$digit1,1);
print substr("0123456789",$digit2,1);
print "\n";
exit;
__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com
This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:13:25 CDT