If you're trying to find out what modules your program is using, then the following piece of magic may suffice:

END { foreach my $file (sort keys %INC) { my $module = $file ; my $located = $INC{$file} ; $module =~ s|\.pm$|| ; $module =~ s|[/\\]|::|g ; my $version ; { no strict 'refs' ; $version = ${$module.'::VERSION'} || '??' ; } + ; print STDERR "$module v$version $located\n" ; } ; } ;
if inserted at the start of your program, just before it ends it will print to STDERR all the module file names it has seen require and/or use for. Which may give you a fighting chance of constructing a suitable install package.

Mind you, this will miss any require operations which your test run does not actually execute... I cannot imagine that this will be a problem, but it's tricky to guarantee. If that worries you, you can try:

END { my %myINC = () ; foreach my $file (keys %INC) { my $module = $file ; $module =~ s|\.pm$|| ; $module =~ s|[/\\]|::|g ; $myINC{$module} = $INC{$file} ; } ; foreach my $module (sort keys %myINC) { my $located = $myINC{$module} ; my $version ; { no strict 'refs' ; $version = ${$module.'::VERSION'} || '??' ; } + ; print STDERR "$module v$version $located\n" ; open my $FH, "<", $located or die "failed to open $located: $!" +; while (<$FH>) { if ((m/^(?:\s+|[^#;];\s*)*?require\s+([A-Za-z]\w+(?:::\w+)*)\b/) && !exists($myINC{$1 +})) { printf STDERR " %5d: %s", $., $_ ; } ; } ; } ; } ;
which has a stab at scanning all the required files, looking for require statements for modules (ignores version numbers) that refer to modules that are not already known.

NB: this comes without warranty of any kind, in particular no warranty of fitness for any purpose whatsoever; and if you use this you acknowledge that such exclusion of warranty is entirely reasonable, given the level of the fee :-)


In reply to Re: Making a distribution for my website by gone2015
in thread Making a distribution for my website by locked_user sundialsvc4

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.