I had gotten the idea that a "package" was necessarily a completely separate file of stuff - that could then somehow be imported (and that a Module was "simply" a specific kind of package) and then accessed/used/referenced.
You've got that impression because thats the standard way it's used :-) It normally makes not much real sense to put multiple packages in a single
script file. Imagine you write a script where you put your
package Astronomers; with a longish hash and
package Constellations; with a longish hash and your code below in main. The other day you need both packages again for a second script. Then you copy and paste both packages into your new script file....an excellent source for bugs.
Regarding the "longish hash" itself. It's a design flaw to have modules/packages that do nothing than containing data. It's better to save your data where it belongs, in a file or a database, and let you're code read it. That way it's far easier to copy with changes in your data.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.