in reply to What is this Moose mojo?

“Security” is not really the issue here, as long as you understand what you are doing and test everything properly. In other words, I don't think that this implementation is flawed by any means.

Okay, I've done some more studying-and-scratching on this one, and here is the understanding that I've come up with. Fellow Monks, please tell me if I'm right.

  1. The declaration will automagically create the appropriate accessor-routines, without me having to do anything further. In other words, “these are the names of methods that will magically appear,” not “the names of methods that you are obligated to provide.”
  2. This module-author intentionally chose a “non-standard” name for his read-accessor routine, by prefixing an underscore '_' to the name. Then, he provided what amounts to a read-accessor of his own, with the name that you would have expected. And this one calls the accessor created by the preceding declaration.
  3. There would have been a conflict had he said sub _fif, because then there would have been two subs by that name. But here, “that name's not taken,” so it's okay.

(Blink...)   Yes?

Replies are listed 'Best First'.
Re^2: What is this Moose mojo?
by Anonymous Monk on Feb 05, 2009 at 15:49 UTC

    See id:/741465. I can't (I'm just too lazy, to install all this stuff) check, but are you sure that when you calling $field->fif the right function is invoked? It looks like a bug for me. Author should s/reader/accessor/ or just remove is property.

    zwon