> Undefined subroutine &main::randsalt called at ./test.pl line
indicates, that he tries to call randsalt in the main package, where is no randsalt. So I think (as I posted above), that he forgot to qualify the name or to export the function.
What else reason could lead to that error message?