in reply to Re: Re: Words without a Dictionary
in thread Words without a Dictionary
#!/usr/bin/perl { my @words = qw( perl monk vroom ); my %convert = ( i => '!', e => '#', s => '%', o => ')', ); sub generate_password { my $word = $words[rand @words] . $words[rand @words]; $word =~ s/(.)/$convert{$1} || $1/eg; $word; } } print generate_password(), $/;
------
We are the carpenters and bricklayers of the Information Age.
Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.
Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.
|
|---|