Fixing Legacy Perl Functions With Decorators
Fixing Legacy Perl Functions With Decorators
Function decorators give us a way to modify a function’s behaviour without changing its source. This is useful in changing the behaviour of complex or legacy functions that you don’t want to touch.
Although perl does not have a built-in syntax for creating or using decorators, typeglob manipulations are used to easily fill the gap.
See also:
- Reddit discussion of this article
- Prior art:
- Python’s decorators in Perl