First of all complain to the author of File::Temp. The older versions did not have problems with File::Spec, and core modules shouldn't force people to upgrade without good cause.

However you can do the following trick. Copy the current File::Spec to Overwrite/File/Spec.pm somewhere, and then at the beginning of it put the following bad hack:

my $old_warn; BEGIN {$old_warn = $^W;} $^W = $old_warn;
Now "use Overwrite::File::Spec" will replace all of the methods in File::Spec with the more recent stuff, and avoid the warning.

You may need appropriate modifications to overwrite modules pulled in by File::Spec as well...

BTW the above hack? I would document why it is being done. It is bad, and when you upgrade you want to document why it is being done. In fact inside the private copy you might put a VERSION check that will die if it is overwriting something recent, just so you don't forget about this kludge...


In reply to Re (tilly) 1: Forcing use of newer (local) version of core module by tilly
in thread Forcing use of newer (local) version of core module by jwd

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.