in reply to Forcing use of newer (local) version of core module
File::Spec might pull in something else on a different OS. Experiment. The key thing here is the deletion from %INC, which if we leave %INC as it is, will prevent use and require from recompiling a module.#!/opt/perl/bin/perl -w use strict; use warnings; use FindBin; BEGIN { delete $INC {'File/Spec.pm'}; delete $INC {'File/Spec/Unix.pm'}; } use vars '$old_W'; BEGIN {$old_W = $^W; $^W = 0} use libs '....'; # The 'cousin' directory here. use File::Spec; BEGIN {$^W = $old_W}
Note that you'll get warnings if File::Spec would do a use warnings.
-- Abigail
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Forcing use of newer (local) version of core module
by Anonymous Monk on Jul 06, 2001 at 04:30 UTC |