in reply to Timing a Module Load

For one thing, use happens at compile time so you're not really timing anything with your code. What you'd really want to do is use require instead and clobber the corresponding entry in %INC before attempting to reload.

Update: Alternately, load the module source into a scalar and use eval "$source" instead.

Replies are listed 'Best First'.
Re^2: Timing a Module Load
by geekondemand (Scribe) on Apr 29, 2005 at 20:00 UTC
    Thanks! I actually figured this out and now have
    do "my_module.pm";
    instead of
    use my_module;
    I think that does the clobber of %INC and forces the reload. My guess is that this differs from eval "$source" solution you mention only in that I'm actually reading the module from disk each time with the "do" solution.