http://www.perlmonks.org?node_id=1014776

beurive.denis has asked for the wisdom of the Perl Monks concerning the following question:

Hello,

I've a question about modules.

It seems to me that the name of the file that implements a module should be the name of the module.

For example, let say that I want to write the module "MyModule".

I create the file "MyModule.pm".

This file looks somethong like :

package MyModule; use strict; # The code... sub myFunction { } 1;

Recently I used modules that do not follow this convention. Please note that these modules do not declare "use strict"…

For example, the module looks something like :

The module's file is "MyModule.pm". And the code looks something like :

package HR; #### <===== HR, and NOT MyModule !!!! use strict; # The code... sub myFunction { } 1;

I had many problems with these modules…

Is it a problem if the name of the module (as declared by "package"), is not the name of the file ?

I think that it is a problem...

But I can't explain why.

Could you explain me ?

Thank you,

Denis