in reply to BEGIN and compile-time

I apparently don't understand what you mean by not being able to modify the load path, since your executing use lib '../'; which is modifying @INC.

Why don't you just do

use lib '../'; use ModX;

and be done with it?

Update: After re-reading the original post, it seems you are trying to perform magic within ./ModX.pm to replace itself with ../ModX.pm. Any particular reason you don't just replace it then?

Replies are listed 'Best First'.
Re^2: BEGIN and compile-time
by jbert (Priest) on Nov 02, 2006 at 15:54 UTC
    The reason is that changes over time are likely to ../ModX.pm, which a copy won't keep up to date with.

    Until a robust way of changing everything to use ../ModX.pm directly is deployed, it is useful to have ./ModX.pm proxy directly to the live ./ModX.pm

    (Oh...and symlinks aren't likely to survive the version control system.)