Rob Dixon wrote:

This will do what you want. It shuffles all of the possible characters and
joins them into a string, and then finds the first substring of six
characters that starts with a non-numeric character. The only proviso is that
a password can never have the same character twice, which isn't true of the
general solution.

  use List::Util qw/shuffle/;

  my $chars = join '', shuffle (0..9, 'a'..'z', 'A'..'Z');
  my ($password) = $a =~ /(\D.....)/;

My apologies: I posted an early version of that. Here is the working one:

  use List::Util qw/shuffle/;

  my $chars = join '', shuffle (0..9, 'a'..'z', 'A'..'Z');
  my ($password) = $chars =~ /(\D.....)/;

Rob

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to