Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Password with hashes

by I_love_perl (Novice)
on Aug 10, 2012 at 15:26 UTC ( [id://986764]=note: print w/replies, xml ) Need Help??


in reply to Password with hashes

Hi,

If you already have the user name in the hash (i.e as key) then you can check whether it actually holds any value in it by:

if ($hash{"user_name} =~ /^\s*$/) { # Logic goes here to insert a password $hash{"user_name} = $password; }

Note that the above logic is written based on the assumption that the password cannot be just space characters and also no need to insert a password to an user who already has a password.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2024-05-22 20:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found