in reply to lock config::IniFile

The single quotes prevent variable interpolation so you are trying to lock a file called $cfgpass in the current directory. Try using double quotes or no quotes.