in reply to Overloading subs = weirdness in mod_perl
when I modify the parameter it appears my scalar reference suddenly maps back to overloaded sub instead of the original, thus creating an infinate self referencing call
I am taking an educated guess, but I think this is because mod_perl runs your code in a persistent environment. It does not "restart" each time. Once you override the WSC::Image::list_images subroutine, it stays like that. Then the next time your code is called, you take a new reference to that subroutine, which is still overridden by your own sub. Thus, the infinite loop.
You need to work out a way to store the original subroutine reference once and only once, then use that reference every time. Perhaps you could get this working with a BEGIN block, but again, I'm just taking an educated guess.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Overloading subs = weirdness in mod_perl
by cfreak (Chaplain) on Nov 15, 2004 at 22:50 UTC |