#!/Users/newby/.local/perl -w                                                   

use strict;

print crypt("hello", "aa") . "\n"; 

# From "man perlfunc"
my $pwd = (getpwuid($<))[1];

system "stty -echo";
print "Password: ";
my $word;
chomp($word = <STDIN>);
print "\n";
system "stty echo";

if (crypt($word, $pwd) ne $pwd) {
    die "Sorry...\n";
} else {
    print "ok\n";
}
