Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Crypt::GeneratePassword with no special characters

by bm (Hermit)
on Aug 21, 2003 at 13:04 UTC ( #285449=note: print w/ replies, xml ) Need Help??


in reply to Crypt::GeneratePassword with no special characters

$restrict= quotemeta ("!@#$%^&*()_-=+/");
or
$restrict= '!@#$%^&*()_-=+/';

--
bm


Comment on Re: Crypt::GeneratePassword with no special characters
Select or Download Code
Re: Re: Crypt::GeneratePassword with no special characters
by Mark2117 (Initiate) on Aug 21, 2003 at 13:42 UTC
    I am still getting the specail characters. Have I interpreted the documentation incorrectly??

    $word = chars($minlen, $maxlen [, $set , $characters, $maxcount ... ] );

    Generatess a completely random word between $minlen and $maxlen in length. If $set is given, it must be an array ref of characters to use. You can restrict occurrence of some characters by providing($characters, $maxcount) pairs, as many as you like. $characters must be a string consisting of those characters which may appear at most $maxcount times in the word.
      Yes, it looks like you are mis-interpreting.

      If $set is given, it must be an array ref of characters to use

      so this argument contains the list of chars to use, as opposed to not using. Perhaps you want:

      $Password=chars(5,8,\('a'..'z'));
      which should create a password between 5 and 8 chars in length, containing only lowercase chars from 'a' to 'z'.
      Hope this helps
      --
      bm
        bm,

        Thank you! You were right. I was trying to the use the $characters restrict function. However, the set option was much more applicable.

        Thanks Again,
        Mark

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://285449]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2014-07-23 01:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (131 votes), past polls