in reply to Separate files for CPAN dist

This is of great importance when you are running your scripts under mod_perl
Example - You have files

Some/Module.pm
SomeOther/Module.pm

you have 2 perl files that use them (use Module.pm <= note just the file name not directory )
a.pl and b.pl
when u test this by running in a single server mode (httpd -X) you will notice that only the first one will run and the second gives an error
This is because the modules didnt declare the package name and there is some sort of namespace pollution
apparantly the %INC hash has already the key called called Module.pm and dosent load the second Module
This is explained in the practical mod_perl book Here
Update
Please check brian_d_foy's answer to this, It is explained clearly .I had got this wrong

Replies are listed 'Best First'.
Re^2: Separate files for CPAN dist
by brian_d_foy (Abbot) on Jan 07, 2005 at 20:19 UTC

    You don't use a filename with use(), and it's not just flat namespaces that have the problem.

    The problem is a combination of the inner workings of %INC and @INC. If @INC has a relative path in it, and it finds the requested module in the current working directory, it loads it. That could be a name like ./Module.pm or nested path like ./Foo/Bar/Baz/Module.pm. Later in the script (or system like mod_perl), if we try the same thing from a different directory where there is the same relative path but to a different module, %INC thinks it already loaded it. It's the path that matters, not the module file name. %INC just stores the path name. A relative path can represent multiple files, but an absolute path points to one file.

    This doesn't bite people with regular scripts because they don't have to worry about persistence. This bites people under mod_perl because a lot of scripts share %INC, and somebody may have already loaded a module. It only bites them if they use relative paths in @INC. If they don't do that, they should get what they expect. Modules like FindBin can help a script figure out where it is, although I prefer to simply install modules in known locations.

    Still, this doesn't have anything to do with the layout of a distribution or what its files should be named, at least no more than it does in any other situation.

    --
    brian d foy <bdfoy@cpan.org>
      Thanks for showing me the Light .. really appreciate the same :-)