Was actually curious so went poking and I think it's a bug / mis-implemented feature that won't work as is now (presuming I'm reading the docs right and my empirical messing around was done correctly).

According to the documentation it's so that you can (paraphrasing) define class methods which will override the defaults for things like requires_firewall (which looks like the only specific method at any rate). But since the Net::Config would be a child of the putative Net::LocalCfg class then its (Net::Config) local version would override the parent's (Net::LocalCfg) implementation.

To do what it says on the tin you'd need to have your own subclass of Net::Config with the special behavior therein so that when you call the class method on that it'd do the right thing and find your custom overridden version.

My test local module is loaded, but as you can see the "override" isn't called.

$ cat foo/Net/LocalCfg.pm #!/usr/bin/env perl use 5.034; package Net::LocalCfg; BEGIN { say qq{## Loaded my LocalCfg}; } sub requires_firewall { my( $class ) = shift; say STDERR qq{## LocalCfg requires_firewall '$_[0]'}; return (rand() < 0.5) ? 1 : 0; } 1; __END__ $ perl -I ./foo -MNet::Config -E 'say Net::Config->requires_firewall( +q{google.com} )' ## Loaded my LocalCfg 0 $ perl -I ./foo -MNet::Config -E 'say Net::LocalCfg->requires_firewall +( q{google.com} )' ## Loaded my LocalCfg ## LocalCfg requires_firewall 'google.com' 0

The cake is a lie.
The cake is a lie.
The cake is a lie.


In reply to Re^2: Missing Module in CPAN by Fletch
in thread Missing Module in CPAN by roho

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.