[kw-pm] potentially dumb perl question regarding packages

abez abez at abez.ca
Thu Oct 27 11:04:25 PDT 2005


Packages are used to create modules, you don't need to make PM files to
use packages. Some applications, like classes, require packages to
handle namespace issues. Did they use base or modify the @ISA array in
that fred package?

On Thu, 27 Oct 2005, Robert P. J. Day wrote:

> 
>   some perl code i've inherited has a number of ".pl" files with the
> following structure -- consider a sample file fred.pl:
> 
> =============================
> 
> #!/usr/bin/perl
> ...
> 
> package fred;
> 
> ... executable code ...
> 
> 1;
> 
> ==============================
> 
>   i understand the concept of defining a package name in a .pm file,
> but this is just a regular executable file and it doesn't appear to
> need to be part of any package.
> 
>   what is the rationale for defining a package for a top-level
> executable file?
> 
> rday
> 
> p.s.  this file *does* "use" a number of module files, but they have
> no relation to the above package name in any way.
> _______________________________________________
> kw-pm mailing list
> kw-pm at pm.org
> http://mail.pm.org/mailman/listinfo/kw-pm
> 

-- 
abez ------------------------------------------
http://www.abez.ca/ Abram Hindle (abez at abez.ca)
------------------------------------------ abez



More information about the kw-pm mailing list