in reply to Problem with functions in modules

So, did you actually declare the subroutine ReadConfigFile? It does not suffice to say that you will be exporting ReadConfigFile, you also need to write the code into a subroutine and that subroutine must be named ReadConfigFile. For example like the following:

package Hello; sub ReadConfigFile { my ($file) = @_; warn "Reading of config file '$file' is not yet implemented."; };

Replies are listed 'Best First'.
Re^2: Problem with functions in modules
by nisha (Sexton) on Oct 26, 2005 at 09:46 UTC
    Yes i have written the subroutine ReadConfigFile in Hello.pm and from the script Hello.pl i am invoking ReadConfigFile.
    use Hello; ReadConfigFile();
    I have used this in Hello.pl and i have also tried use Hello qw(ReadConfigFile); instead of use Hello; I have multiple functions in the @EXPORT, is there any particular order that i need to follow, i tried lot of sites..i am just not able to figure out why it throws "Undefined subroutine &Hello::ReadConfigFile at c:\test\hello.pl in line 30". Please help..

      Maybe then it could help us to further see what you're doing wrong if you showed us the code of ReadConfigFile. Please read and understand How (not) to ask a question to help us to answer your questions in a better way.