in reply to understand crypt

> even if $encpw is replaced with $salt it works, both work.

IIRC only the first 2 bytes of a salt are relevant, and crypt creates a 13 bytes string including the original salt in the first 2 characters.

See crypt

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery FootballPerl is like chess, only without the dice