thor has asked for the wisdom of the Perl Monks concerning the following question:
I'm writing a module and found myself debating as to what to call one of the methods. Neither of the two names was better, so I want to provide both and let the coder choose which s/he likes. Now, I've seen a couple of ways to do this. Assume that we already have a method called "foo" that we want to have an alias of "bar":
I don't really have a preference, but I don't want to seem like a dolt, either. How do you treat this situation when you encounter it?*bar = \&foo; #has always seemed a bit heavy handed to me sub bar { return(foo(@_)); #is there something hidden and wrong here? seems too simple... } #others?
thor
Feel the white light, the light within
Be your own disciple, fan the sparks of will
For all of us waiting, your kingdom will come
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Current en vogue technique for aliasing subs
by GrandFather (Saint) on Aug 29, 2005 at 22:33 UTC | |
by Tanktalus (Canon) on Aug 29, 2005 at 23:41 UTC | |
|
Re: Current en vogue technique for aliasing subs
by Tanktalus (Canon) on Aug 29, 2005 at 22:32 UTC | |
by graff (Chancellor) on Aug 30, 2005 at 02:27 UTC | |
|
Re: Current en vogue technique for aliasing subs
by ysth (Canon) on Aug 29, 2005 at 23:40 UTC | |
|
Re: Current en vogue technique for aliasing subs
by InfiniteSilence (Curate) on Aug 29, 2005 at 22:49 UTC | |
|
Re: Current en vogue technique for aliasing subs
by polettix (Vicar) on Aug 30, 2005 at 10:36 UTC |