Dear Monks,

I am currently trying to reverse-engineer a fairly large Perl web application I have inherited, that relies heavily on the CGI and CGI::Template modules, as well as a host of custom modules.

There is a lot of manipulation of where perl locates the custom modules, and unfortunately, they seem to be duplicated in several places.

So, my simple (hopefully) question is - how do I find which "instance" of a module is actually used?

For example, with a statement such as:

my $util = new MyApp::Utilv2;

how can I find out which one of the several possibilities was actually invoked?

Yes, that should probably be written as

my $util = MyApp::Utilv2->new()

but like I said, I inherited this!

Utilities such as perlwhich etc probably won't help me here, since so much manipulation of @INC, use lib etc is going on.


In reply to Get path to module by mjscott2702

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.