Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

i was wondering, if there's already a module named, say, SomeModule, and i create a module under that namespace like SomeModule::SomeOtherModule, even if my module SomeOtherModule doesnt actually USE any subs or anything from SomeModule, does someone HAVE to install SomeModule to install MY module?

Replies are listed 'Best First'.
Re: Module question...
by jj808 (Hermit) on Oct 06, 2001 at 12:45 UTC
    No.

    When Perl tries to load a module, the double-colons (::) in a module name are translated into your system's directory seperator and appended to each value of @INC in turn. So if @INC contained /usr/lib/perl5/site_perl/ and your module name was Some::Funky::Module then Perl would try to load /usr/lib/perl5/site_perl/Some/Funky/Module.pm. The only file which needs to exist is Module.pm (although obviously the directories need to be created).

    Cheers,

    JJ

Re: Module question...
by blakem (Monsignor) on Oct 06, 2001 at 12:41 UTC
    No, ABC::DEF doesn't necessarily have any relation to ABC. Convention suggests that they could (should?) be related, but there are many cases where ABC::DEF, ABC::GHI, ABC, and DEF::ABC have nothing to do with one another. They can be as dissimiliar as $dog and $doghouse....

    -Blake