in reply to How to store a password in a file

Pick an encryption algorithm that suites your needs. Then change the line that does:
printf $file "%s:%s\n", $username, $password;
by
use Favourite::Encryption::Module qw[encrypt]; printf $file "%s:%s\n", $username, encrypt $password;