Save the state of the %INC before the loop, and restore it at the beginning of each iteration.
Something as simple as this might work, assuming %INC isn't a tied hash:
Or alternatively:%INC = %old_INC;
for (keys %INC) { delete $INC{$_} if ! $old_INC{$_}; }
In reply to Re^3: Changing Module Tree
by wind
in thread Changing Module Tree
by lackita
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |