Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Understanding module structure and inheritance

by naikonta (Curate)
on Jan 30, 2008 at 18:58 UTC ( #665190=note: print w/ replies, xml ) Need Help??


in reply to Understanding module structure and inheritance

Just to add some notes....

I hope you're not confused between package main and Main. The former is automatically provided by Perl and each Perl program are implicitly in a package main. The later is normal user-defined package name.

Package Main::Contact indicates nothing about inheritance between Main and Contact, the double colon ("::") notation indicates physical structure where Main is the directory under which the file Contact.pm is located (it doesn't mean though that Main.pm doesnt exist).

About the layout.... I get used to put my private Perl modules under directory lib as found in CPAN module distributions (e.g. CGI-Application-x.yy/lib/CGI/Application.pm). You may also use lib/perl as seen in the standard Perl module directories layout by the system (e.g /usr/lib/perl or /usr/lib/perl5). If there are more sibling directories (as in my case), they are all under single directory (e.g. myappl) so later I can say,

use lib '/path/to/myappl/lib'; # or #use lib '/path/to/myappl/lib/perl'; # whichever the case
to let Perl knows where to search for my private modules.

Open source softwares? Share and enjoy. Make profit from them if you can. Yet, share and enjoy!


Comment on Re: Understanding module structure and inheritance
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://665190]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (10)
As of 2014-11-29 00:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (200 votes), past polls