How can I redefine Perl class methods?

前端 未结 5 1833
日久生厌
日久生厌 2020-12-30 08:27

The question \"How can I monkey-patch an instance method in Perl?\" got me thinking. Can I dynamically redefine Perl methods? Say I have a class like this one:



        
5条回答
  •  梦谈多话
    2020-12-30 08:53

    I've never tried it with methods, but Memoize may be what you're looking for. But be sure to read the caveats.

提交回复
热议问题