#!/perl/bin/perl

# test.pl
# Testing the password file . . .

    $PwdFileName = "password";
    $PasswordString = $ARGV[0];

# Open the file . . .

    open (PWD, $PwdFileName) ||
        die "Can't open $PwdFileName for reading: $!\n";

# Read the encrypted password.

    $EncryptedPassword = <PWD>;

# Do the comparison with crypt()

    if (crypt ($PasswordString, $EncryptedPassword) eq $EncryptedPassword)
        {
        print "Password is OK\n";
        }
    else
        {
        print "Incorrect password...Try again\n";
        }

#                    End test.pl
