Here's one that will generate a password exactly 8 characters long composed
of two words with a random punctuation character between. (I'd just
composed this for someone else.) Substitute an appropriate name of a file
of words (one per line, no punctuation) if you don't have /usr/dict/words.
perl -le 'open IN, "/usr/dict/words"; chomp(@words = grep
length $_ < 7 && length $_ > 2, <IN>); @c = qw(! @ # $ % ^ & * + . , );
$pw = $words[rand @words].$c[rand @c]; @rest = grep length == 8 - length
$pw, @words; print $pw, $rest[rand @rest]'
--
Peter Scott
Pacific Systems Design Technologies
http://www.perldebugged.com