use Crypt::Password 'password'; my $password = 'abc'; my $crypt = '$1$Wl2RANfv$M9PjezS//sUMDRnhhO5vR1'; print "Password matches\n" if password( $password, $crypt ) eq $crypt;