Re: Need suggestions for terminology

Eric Wilhelm <[email protected]>
Newsgroups gmane.comp.lang.perl.quality-assurance
Message-ID <[email protected]>
# from Michael G Schwern
# on Friday 02 December 2011 19:10:

>> Module: I actually avoid using the term Module because I think it is
>> often misused.  I feel that a Module is a physical file (i.e.
>> something that you "use").  But some folks use the terms Module and
>> Package interchangeably.  To be precise, CPAN (and Pinto) index
>> Packages not Modules.  So when you ask cpan[1] to install Foo::Bar,
>> what you actually install is an Archive that contains some Module
>> that provides Package Foo::Bar, and that Module may or may not be
>> called Foo/Bar.pm. At least, that's how I understand it.
>
>Agreed that "module" is overloaded.  I would associated it either with
>the .pm file or with the distribution.  Probably best to avoid it all
> together.

True.  But, what do you call:

  1)  The thing which is a first argument to use() ?
    (it's shaped like a package name, but means a file to be loaded
      (without accounting for subrefs in @INC))

  2)  The "Foo/Bar.pm" argument to require() ?

I would say that:

  1) "Foo::Bar" in that usage is a "module name".

  2) "Foo/Bar.pm" is a "module path"

The distinction between a "module name" and a package, is that a module 
name can be translated into a module path with:

  ($name = $path . '.pm') =~ s{::}{/}g;

--Eric
-- 
Any sufficiently advanced incompetence is indistinguishable from malice.
--The Napoleon-Clarke Law
---------------------------------------------------
    http://scratchcomputing.com
---------------------------------------------------
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.