"be consistent" | |
PerlMonks |
Re^2: Need help with a conceptual speed bumpby mstone (Deacon) |
on May 03, 2005 at 23:22 UTC ( [id://453773]=note: print w/replies, xml ) | Need Help?? |
Hmm.. that's true, but this:
Gives us a dump that looks like so:
The difference doesn't appear to be large there, either. This time the switch is between ex-rv2sv / rv2sv and gvsv / gv. I don't have a copy of the perl source at hand, but I'd imagine the behavior is much the same as in method and method_named. The problems are similar, after all. The point is, that little bit of indirection occurs in a place where things can go blooey with frightening ease. Imagine code that took the method name as a function parameter instead of looking it up in a statically-defined list. Yucko. Granted, Perl won't auto-vivify functions or clobber a function definition because of a typo, so this is less dangerous than using symrefs for lvalues, but the general mechanism can still be used to do some horribly ugly things. Still, you've tipped the scale a bit further in the "less dangerous than flossing with a loaded shotgun" direction, so thanks for your time.
In Section
Seekers of Perl Wisdom
|
|