Lazy == Cache ?
While I was working on some Moose code this past week, I was struck (again) by how the lazy
property of attributes functions almost like a cache. In fact, often when working in Moose I find that when I want something to be cached, I just make it lazy and call it a day.
Let me illustrate what I’m talking about with some code. Now, the real process of putting this code together involved a lot of blind alleys and false starts, but I’m going to present it like I came up with the final product smoothly and without interruption. …