First of all I think that your design is flawed, because you shouldn't require a script in order to make a module work, but that is besides the point.
My guess is that, require puts &subroutinefrom_myperlscript();, in the main package, and the .pm file is using another package. Try
&main::subroutinefrom_myperlscript();