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
In reply to Re: Reading a password from the user
by Abigail-II
in thread Reading a password from the user
by rupesh
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |