in reply to Current en vogue technique for aliasing subs

Using import? ;-) Personally, I always go for the former choice over the latter. The latter is great for closures and stuff, but the former has a distinct simplicity that makes it quite explicit that I'm making an alias, end of story. I suspect that the former is also faster in that it's one less function call on the stack, but that's usually a secondary concern, if a concern at all.

  • Comment on Re: Current en vogue technique for aliasing subs

Replies are listed 'Best First'.
Re^2: Current en vogue technique for aliasing subs
by graff (Chancellor) on Aug 30, 2005 at 02:27 UTC
    the former is also faster in that it's one less function call on the stack, but that's usually a secondary concern, if a concern at all.

    Well, yes, usually the extra stack work wouldn't amount to much, unless/until the alias in question ends up getting called two million times on a given data set...

    Wouldn't that be a fun and enlightening exercise in benchmarking? Someone uses the same module with the same test code on the same data set, but just switches between the "alias" name and the "real" name of the function, and gets to see the impact of the extra stack layer. (But I can imagine that some folks would feel like they had better things to do with their time.)