Agreed, more info needed about what this is for. Is it a web system ?. is it some UI ? is it somthing that will give destructive power?. Risk asseement is needed then you can devise a method for the ammount of security you need.
In general passwords are weak protection, but also one of the most basic forms of protection. there are many articles on the web about risk assesment and password sucurity/policies.that i am not gonna go into in the scope of this post. see
SecurityFocus
Besides that. I would look into cpan
Crypt, and the perl
crypt implentations. Most password systems story only the crypted version of the password and compare the user input crypted and matched against the stored crypted string. This way the file has no plain password, unfortuanatly the standard DES encryption is verry week and can be brute forced quite fast.
If this is a web system on apache there are many ways to authenticate users.
Apache Docs other than that make the file 0400 only by the user that runs the script. and make sure that its not acessable via the web or some other remote connections.