in reply to Reading a password from the user

perldoc -f crypt

Abigail

Replies are listed 'Best First'.
Re^2: Reading a password from the user
by Coruscate (Sexton) on Apr 05, 2003 at 06:40 UTC

    Note that the author's original question had nothing to do about encrypting strings :P


    My bad, Abigail-II's reply below shows how I was a little too quick to post. It seemed odd to me that Abigail-II would post irrelevant information, as I know how well she knows her stuff :)


    If the above content is missing any vital points or you feel that any of the information is misleading, incorrect or irrelevant, please feel free to downvote the post. At the same time, please reply to this node or /msg me to inform me as to what is wrong with the post, so that I may update the node to the best of my ability.

      So? Did you actually bother to look up what perldoc -f crypt displays? Or did it give you more satisfaction to write a stupid reply than to do some trivial research. Let me quote it for you:
      Here's an example that makes sure that whoever runs this program knows their own password: $pwd = (getpwuid($<))[1]; system "stty -echo"; print "Password: "; chomp($word = <STDIN>); print "\n"; system "stty echo"; if (crypt($word, $pwd) ne $pwd) { die "Sorry...\n"; } else { print "ok\n"; }

      Abigail