in reply to Messing with %INC.

How about doing the file? (See also the description and pseudocode in require.)

Replies are listed 'Best First'.
Re^2: Messing with %INC.
by Theodore (Hermit) on Apr 24, 2014 at 13:39 UTC
    Indeed, using do should be lighter and 1 line of code shorter.
    my $code = "require '$fn'"; eval $code;
    can be replaced by:
    do $fn;
    Thanks!

      More than that: do re-evals the file each time it is called, so your manipulation of %INC is not necessary.

        Yes, you are right. That's what i was looking for. So, never mess with %INC still holds as a good advice.