jettero has asked for the wisdom of the Perl Monks concerning the following question:
I'm attempting to do an AUTOLOAD thing to give my API programmers access to a new feature. I want to do this transparently. So, I came up with this scheme
# this is something like the code from my AUTOLOAD # if they call the function the old way, we never # get in here... if they call the function with # _r on the end, it gets here, strips off the _r # and calls the old function. :) API->use_the_new_way $return_value = &{ $func }( @_ ); API->go_back_to_the_old_way return $return_value;
The problem is, sometimes the $func doesn't return a scalar, sometimes it might be a filehandle or a hash or something... I don't even know how to approach this problem, or how to phrase it. ... Unless I get a really good hint, I'll just keep chugging on it...
It occured to me that this might not be the best design in the whole wide world. That doesn't bother me, I still want to know how to do this (even if I never use it for anything).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: uber-reference
by merlyn (Sage) on Dec 30, 2000 at 00:35 UTC | |
by jettero (Monsignor) on Dec 30, 2000 at 01:06 UTC | |
by tye (Sage) on Dec 30, 2000 at 01:14 UTC | |
|
(tye)Re: uber-reference
by tye (Sage) on Dec 30, 2000 at 01:12 UTC |