in reply to ascii to binary

packing with "A*" will just get you ascii, which is why you see "my_user|my_pass" (perldoc -f pack) ..

Just using pack isn't going to keep your data private because anyone that can read it can just unpack it just as easily as you can. To start, you should be sure to make the permissions very restricted on that file. Even better would be to store the password as MD5 hash. Then when you need to check it, you ask for the user's name and password. First MD5 that provided password, then try to find that pair in your password file. To one-up that, i would also search cpan for passwd and auth (i don't have a specific recommendation offhand).