in reply to Re (tilly) 1: Redefining Exported Subroutines (esp. in mod_perl/mason)
in thread Redefining Exported Subroutines (esp. in mod_perl/mason)

Ahhh, very enlightening.... You are correct. Moving use My::Module qw(testsub) to the end, or calling My::Module->import(qw(testsub)) both seem to give me the behaviour I wanted.

I'll have to recheck my example to see if it also applies to the mod_perl issues I'm having.

I understand your caveat, but in my mod_perl development environment the exported subroutine is simply clobbering an older version of itself. I'm essentially just trying to un-cache the subroutine after it gets modified on disk.

Thanks.
-Blake

Update:

This does solve my mod_perl problem. The difference between the following two lines is the key.
1. use My::Module qw(testsub);
2. use My::Module; My::Module->import(qw(testsub));

#1 imports when the module is loaded, #2 imports at runtime. thanks again.

-Blake