in reply to Forcing use of newer (local) version of core module
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:
Now "use Overwrite::File::Spec" will replace all of the methods in File::Spec with the more recent stuff, and avoid the warning.my $old_warn; BEGIN {$old_warn = $^W;} $^W = $old_warn;
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...
|
|---|