But the Second gets compiled without any such errors. Why?
Mmm, probably because Perl is programmed to
Do The Right ThingTM.
I know that's not a real answer, but I still don't understand why you bother about it anyway.
Do you have a specific problem with two modules like this? Do you just like to understand better how Perl is loading packages? Please give us some more information.
As I already pointed out in my last reply to your last question functions seem to be looked up at run-time, which has nothing to do whether they get imported at compile or run-time. Look at the following example:
shell# perl -we 'sub test { otherfunc(); }'
This executes without a warning about
otherfunc which doesn't exists, because
test is never called and so
otherfunc() must never be located by perl.
Your way to only compile a module with perl -c module.pm looks strange to me - not the fact that it's not giving a warning.
PS: Please use <readmore> tags for code with this length. You should also put every file in a own <code> </code> container so they can be downloaded separately.
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.