Hey, in the future can you not put an entire script in Perlmonks? Wait until someone asks you for a specific piece of code rather than dump the whole thing.

The answer to your question is going to be rather messy:

# cat foo.pl # ----------- #!/usr/bin/perl -w use strict; use CGI; use LWP::Simple; 1; strace perl foo.pl 2> foo.pl.strace perl -ne 'if(m/(\S+\.pm)/){print qq|$1\n|}' foo.pl.strace|sort|uniq|ca +t -n

Produces (in short):

... 149 stat64("/usr/lib/perl5/site_perl/5.10.0/LWP.pm 150 stat64("/usr/lib/perl5/site_perl/5.10.0/LWP/Protocol.pm 151 stat64("/usr/lib/perl5/site_perl/5.10.0/LWP/Simple.pm 152 stat64("/usr/lib/perl5/site_perl/5.10.0/LWP/UserAgent.pm 153 stat64("/usr/lib/perl5/site_perl/5.10.0/URI/Escape.pm 154 stat64("/usr/lib/perl5/site_perl/5.10.0/URI.pm 155 stat64("/usr/lib/perl5/vendor_perl/5.10.0/Encode/ConfigLocal +.pm 156 stat64("/usr/lib/perl5/vendor_perl/5.10.0/i586-linux-thread- +multi/Encode/ConfigLocal.pm 157 stat64("/usr/lib/perl5/vendor_perl/5.10.0/i586-linux-thread- +multi/Log/Agent.pm 158 stat64("/usr/lib/perl5/vendor_perl/5.10.0/Log/Agent.pm 159 stat64("/usr/lib/perl5/vendor_perl/Encode/ConfigLocal.pm 160 stat64("/usr/lib/perl5/vendor_perl/Log/Agent.pm 161 XSLoader.pm

So, for a script that does nothing interesting and only uses two modules Perl actually checks for the presence of 161 modules. Looking at %INC only shows 37 elements for the same script, so I'm inclined to think that strace is giving me the bigger picture. Figuring out which modules you can live without should be a chore. I think you can save yourself the headache and just put all of the modules a script needs in a PAR archive and reference that.

Celebrate Intellectual Diversity


In reply to Re: disabling unnecessary perl modules by InfiniteSilence
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.