Tobias Toasty
Tobias Toasty

Reputation: 19

perl MakeMaker makefile with submodules

I have created a perl modul with 3 submodules. I want to create a makefile with MakeMaker and have a problem.

My structure of my module is /module.pm and /module/sub.pm.

If i create the makefile only the module.pm file will be included. Which parameter i need to write in the makemaker so the submodules are included too?

Thank you very much.

Upvotes: 0

Views: 135

Answers (1)

cjm
cjm

Reputation: 62109

Don't put your module in the root directory of your distribution. Instead, create a lib subdirectory and put all the modules under it:

Makefile.PL
lib/module.pm
lib/module/sub.pm

The Makefile.PL should automatically notice all modules under lib. You shouldn't have to change anything except any paths pointing to modules (e.g. VERSION_FROM).

If your module has a prefix, include that under the lib directory. If your module is named Some::Other::Module, you'd have:

Makefile.PL
lib/Some/Other/Module.pm
lib/Some/Other/Module/Sub.pm

Upvotes: 1

Related Questions