The reason why strace is more verbose than %INC is that Perl has to stat a file to see whether it exists. So say you've got:

BEGIN { @INC = qw( /tmp/lib1 /tmp/lib2/ /tmp/lib3 ); } use Foo::Bar;

And /tmp/lib3/Foo/Bar.pm is the only module that exists, Perl still has to stat /tmp/lib1/Foo/Bar.pm and /tmp/lib2/Foo/Bar.pm first. Only one actual module is loaded though.

(Actually Perl will also stat /tmp/lib1/Foo/Bar.pmc, /tmp/lib2/Foo/Bar.pmc, and /tmp/lib3/Foo/Bar.pmc too. This is due to a rarely used feature where Perl will try to load modules with .pmc extensions ahead of .pm. The intention is that you might write your code a Bar.pm and then "compile" it to Bar.pmc for deployment. I don't mean "compile" in the same sense that C is compiled; more like what Parse::RecDescent's Precompile method does.)

use Moops; class Cow :rw { has name => (default => 'Ermintrude') }; say Cow->new->name

In reply to Re^2: disabling unnecessary perl modules by tobyink
in thread disabling unnecessary perl modules by samithawijedasa

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.