Try it this way:

#! perl -slw use strict; use Data::Dump qw[ pp ]; my @required = qw( File::Basename File::Copy File::Find ); pp \%INC; my @missing; foreach (@required) { s[::][/]g; s[$][.pm]; eval { require }; push @missing, $_ if $@; } print for @missing; pp \%INC; __END__ C:\test>junk39 { "Data/Dump.pm" => "c:/perl64/lib/Data/Dump.pm +", "Exporter.pm" => "c:/perl64/lib/Exporter.pm" +, "List/Util.pm" => "c:/perl64/site/lib/List/Ut +il.pm", "Scalar/Util.pm" => "c:/perl64/site/lib/Scalar/ +Util.pm", "XSLoader.pm" => "c:/perl64/lib/XSLoader.pm" +, "c:/perl64/site/lib/sitecustomize.pl" => "c:/perl64/site/lib/sitecus +tomize.pl", "overload.pm" => "c:/perl64/lib/overload.pm" +, "strict.pm" => "c:/perl64/lib/strict.pm", "subs.pm" => "c:/perl64/lib/subs.pm", "vars.pm" => "c:/perl64/lib/vars.pm", "warnings.pm" => "c:/perl64/lib/warnings.pm" +, "warnings/register.pm" => "c:/perl64/lib/warnings/reg +ister.pm", } { "Config.pm" => "c:/perl64/lib/Config.pm", "Cwd.pm" => "c:/perl64/site/lib/Cwd.pm" +, "Data/Dump.pm" => "c:/perl64/lib/Data/Dump.pm +", "Exporter.pm" => "c:/perl64/lib/Exporter.pm" +, "File/Basename.pm" => "c:/perl64/lib/File/Basenam +e.pm", "File/Copy.pm" => "c:/perl64/lib/File/Copy.pm +", "File/Find.pm" => "c:/perl64/lib/File/Find.pm +", "File/Spec.pm" => "c:/perl64/site/lib/File/Sp +ec.pm", "File/Spec/Unix.pm" => "c:/perl64/site/lib/File/Sp +ec/Unix.pm", "File/Spec/Win32.pm" => "c:/perl64/site/lib/File/Sp +ec/Win32.pm", "List/Util.pm" => "c:/perl64/site/lib/List/Ut +il.pm", "Scalar/Util.pm" => "c:/perl64/site/lib/Scalar/ +Util.pm", "XSLoader.pm" => "c:/perl64/lib/XSLoader.pm" +, "c:/perl64/site/lib/sitecustomize.pl" => "c:/perl64/site/lib/sitecus +tomize.pl", "overload.pm" => "c:/perl64/lib/overload.pm" +, "re.pm" => "c:/perl64/lib/re.pm", "strict.pm" => "c:/perl64/lib/strict.pm", "subs.pm" => "c:/perl64/lib/subs.pm", "vars.pm" => "c:/perl64/lib/vars.pm", "warnings.pm" => "c:/perl64/lib/warnings.pm" +, "warnings/register.pm" => "c:/perl64/lib/warnings/reg +ister.pm", }

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

In reply to Re: eval array of required modules by BrowserUk
in thread eval array of required modules by halfcountplus

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.