Reading Re: Most specific pattern the other day reminded me of something I was thinking of a while back. It's an interesting question to consider what constitutes an external module, and what is part of perl?

Re: Disputation of g0n on the power and efficacy of XS makes an excellent point in this regard - is a module on CPAN part of perl, or is it open source software? I've always thought of CPAN modules as extra components that can be installed, but sometimes some of them make it into perl distributions. I think many of us would consider the strict pragma to be 'part of perl', but it isn't present in the copy of perl that ships with the Oracle 9i client (on AIX at least).

So that provides one possible distinction. It's 'part of perl' if it's included with the distribution. But then, what distribution? Many vendors ship a version of perl with their products (Oracle for example) but cut it down. So running a perl script on a machine with one of these products might fail for dependencies that we would expect to be present. Other distributions (Activestate for example) include components that are not part of the perl source, so do we consider these to be part of perl? Someone who habitually codes using one of these distributions might consider these 'popular modules' to be part of perl, simply because they are always there.

An alternative distinction is similar to the OS distinction between internal and external commands: commands that are part of the kernel, and commands that are separate executables stored in a pathed location. ls on unix for example is normally a separate executable (although you can get a listing of the files in the current working directory with echo *). (Hmm, TIMTOWDI,where have I heard that before?)

My feeling is that the boundaries of what constitutes 'perl' are amorphous and arguable. Does something become 'part of perl' when it's included in the interpreter? Shipped with the source code distribution? With Activestate? When it appears on CPAN?

I know that the facilities for extending and overloading in perl are perhaps not significantly greater than other languages, but having a single, open repository for reusable modules IMHO makes the distinction between a 'library' and 'part of the language' rather more vague.

So, would anyone care to put forward their take on it?

--------------------------------------------------------------

g0n, backpropagated monk

Replies are listed 'Best First'.
Re: What constitutes 'perl'?
by Tanktalus (Canon) on Jul 06, 2005 at 14:43 UTC

    Well, there's "part of perl", and "part of Perl". I think that we can easily say that "Perl" is more than "perl" - Perl includes the community surrounding perl, which most definitely includes CPAN. And ActiveState, and PM, and ...

    "Part of perl" gets a bit more tricky, but I would consider it on a case-by-case basis. There's the official perl distribution - anything in that distribution is "part of (official) perl". There's ActiveState - anything there is "part of (ActiveState) perl". There's whatever Oracle ships (I'm not sure - I use DB2) and anything there is "part of (Oracle) perl". There is more than one way to distribute it ;-)

    That said, I'm not sure that these details are that important - perl programmers are a pragmatic bunch, so we just use what we have available, and install what we don't but we need. :-)

      That said, I'm not sure that these details are that important - perl programmers are a pragmatic bunch, so we just use what we have available, and install what we don't but we need. :-)
      Yes, but the problem is that it is harder and more annoying to install a module or application if the dependencies are not listed properly. I for one have never listed strict and warnings (among other core modules) in the PREREQ_PM section of my Makefile.PL. I never imagined that someone would dare distribute perl without these modules! (Now, I hope that at least they include ExtUtils::MakeMaker...)
      Well, if you're going to distinguish between 'perl' and 'Perl', than the former is the binary, while the latter is the language. CPAN, Activestate and PM belong to neither. ;-)

      However, when I say "part of perl" (you can't hear the difference between 'perl' and 'Perl'), I mean everything that comes in the tarball. So that includes 'strict.pm', the manual pages and the 'perlbug' program, but doesn't include the DBI and certainly not "the community".