in reply to Re: Re: ??Mnemonic Passwords??
in thread ??Mnemonic Passwords??

JD, when i applied your teqnique for my password generation
sub password { my( $s ) = @_; srand( $s ^ time ); my @c = split / */, "bcdfghjklmnpqrstvwxyz"; my @v = split / */, "aeiou"; return map { $c[ rand @c ], $v[ rand @v ] } 1..4; }
It returned the length of the total array, which is 8.(4 two letter sylables). And that isn't what i wanted to do. I wasn't sure how to fix this because $me = newbie.

Replies are listed 'Best First'.
Re: Re: Re: Re: ??Mnemonic Passwords??
by jdporter (Paladin) on Jan 02, 2003 at 13:48 UTC
    I don't know what you're talking about, and I suspect you don't either.
    The technique I showed worked perfectly for me.
    I'd ask that you try it again.

    Here's how I instrumented the code to prove myself right. (Note that the rp sub must come before, because of the prototype.)
    sub rp($$$) { my $array_name = shift; my $array_size = shift; my $val = shift; printf "$array_name: %d out of $array_size\n", $val; $val } sub password { my( $s ) = @_; srand( $s ^ time ); my @c = split / */, "bcdfghjklmnpqrstvwxyz"; my @v = split / */, "aeiou"; return map { $c[ rp("c",@c,rand @c) ], $v[ rp('v',@v,rand @v) ] } +1..4; }

    jdporter
    The 6th Rule of Perl Club is -- There is no Rule #6.