would you be able to show me how to do this?

By the standards of the Perl Monks, it would be better for you to start by posting your current "totally random" code, and making at least a partial attempt to make the change, instead of just asking someone else to write your code for you.

Nonetheless, here's some working example code. You could easily extend this to make the words longer, or add a list of punctuation characters to mix in, or randomly switch around between a few different patterns of words, like "CVCVC", "VCVCC", and "CVVCV".

# Build arrays of vowels and consonants my @vowels = qw( a e i o u y ); my %vowels = map { $_ => 1 } @vowels; my @consns = grep { ! $vowels{$_} } ( 'a' .. 'z' ); # Also include uppercase letters push @vowels, map uc, @vowels; push @consns, map uc, @consns; # subroutine to pick a random entry from an array sub pick_one { my $array_ref = shift; return $array_ref->[ int rand( @$array_ref ) ]; } # Define a pattern of "CVCVC" my @syntax = ( \@consns, \@vowels, \@consns, \@vowels, \@consns ); # Do this part each time you need a new password foreach ( 1 .. 10 ) { # Generate a random psuedo-word my $word = join '', map { pick_one( $_ ) } @syntax; # Then do something with it... print "$word\n"; }

In reply to Re: Re: Re: Words without a Dictionary by simonm
in thread Words without a Dictionary by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.