in reply to cloning Sun's crypt

I dont know of a perl implementation of the unix crypt(1) command. crypt(1) is notoriously weak and should not be used to encrypt anything that you want to stay secure. The unix crypt(3) function (the one used to encrypt passwords) is implemented in perl, but is a one-way function (i.e. you can only encrypt, not decrypt). Decrypting requires brute-force attack of some sort.

Take a look at the Crypt modules from CPAN. If you are just looking for a general purpose encryption/decruption engine, there are many Crypt modules that would fit the bill: