in reply to encrypting system passwords

Try surrounding your code with the <code> tags as suggested. Here is a repost:

Any ideas why this will not work correctly? I've tried using it's generated password for Apache, Squid, and system logins and it won't work for any of them.
sub mkpasswd { srand(time|$$); $random = "abcdefghijklmnopqrstuvwxyz1234567890"; for (1..2) { $salt .= substr($random,int(rand(36)),1); } return crypt (@_, $salt); } open(PWD,">>/some/file/used/for/apache/auth.txt"); print PWD "@ARGV[0]:" . mkpasswd(@ARGV[1]) . "\n"; close(PWD);