good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I don't suppose you Use strict and warnings (in the script and the module)?? I assume that because otherwise you would immediately get a compile time error about the
undeclared variable (or is that the error you're talking about??). The subroutine error is a run-time error.
Might need to see more code, it doesn't sound like the function is being exported. Is the function in the @EXPORT or @EXPORT_OK list in the module? Is Exporter used in the module? Do you say 'use Module qw(function);' in the script if its in EXPORT_OK, or just 'use Module;' if its in @EXPORT? Is Exporter in the @ISA list in the module? Update: The 'undeclared' error I was talking about is about when you said "I tried removing the my $opendir", and you said that you get an error about it being used later... Anyway, as others have said, did you forget the package declaration in the module ('package NotesOLE;' if that's the name of the module, and the filename is 'NotesOLE.pm')? Is the module 'NotesOLE'? If not, you need to use it in the main script. In reply to Re: Calling a subroutine located in a module
by runrig
|
|