Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
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!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://665190]
help
Chatterbox?
[Discipulus]: marioroy this page linked by haukex is interesting. If I get it i'll try to rewrite the algorithm in another way. The inner for loop seems a pity and a possible canditate fot Memoize.pm or a self made cache
[marioroy]: Discipulus Cool. Also cool is seeing "use integer" run 1.36x faster.
[marioroy]: ... on my laptop versus no integer.
[marioroy]: Contrary to the documentation, it made a difference and I have floating point hw.

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2017-10-24 07:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (286 votes). Check out past polls.

    Notices?