in reply to modules within modules...a question

You have to export that function in encrypt.pm or better call it fully quallified as Encrypt::randsalt() if your package name is Encrypt.