Although I am not a Perl guru, I use Perl and I can write object-oriented programs the "good old" way.
Now I would like to learn Moose. I've already (so-as) chewed the basic documentation, and my first Moose and roles are already working, but I'm miles away from understanding how Moose actually works.
Question 1: Is it absolutely necessary to understand how Moose works to write "pretty good" programs?
Honestly, I don't quite understand the old object system. Something I vaguely remember reading is that it's actually a reference to a data structure, but I never explored deeper. It was sufficient for me to know how and when I needed to use bless
, autoload
etc. and things simply worked. Maybe some of my old modules can be written more effectively. But for me, they work and work well.
Is this similar to Moose? Or does someone writing "enough-good" programs with Moose need to understand how it works "inside"?
The question arises for the following reasons:
In the METACPAN are dozens of modules that help write Moose objects even more easier and simpler.
Examples at random:
and many-many more (don't want cite here another 10-20 modules)
And now the main question:
Are there any good books with the instructions, examples and recommendations (good practices) for:
The above modules were surely not developed only because the author just hasn't what to do. Certainly they are useful and helpful. But learning (read: trying to understand) tens of many different modules (especially those who play with Moose internals) is an extremely long process. On the other hand, if they are not used, my programs will be unnecessarily complicated, and I will be dealing with things already resolved.
Moose should be (and probably is) a revolutionary system. Only I'm starting getting lost.
Edit: I just found Reindeer. Probably this module is a partial answer to the question: what modules are useful to use from the start (or most of time)
PS: I'm not sure than this question is ok for SO. If not, please move it to somewhere or close it. I asked it here because the SO-perl community is a really helpful place, and I don't know how to continue to learn Moose.
Ricardo Signes's "Moose is Perl: A Guide to the New Revolution" contains a lot of valuable information and advice. Grab the PDF here: http://rjbs.manxome.org/talks/moose/
To answer your first question: Not knowing how things work inside is the whole point of abstraction. While knowing the insides sometimes gives you better idea why things work the way they do (and more so with something as complex as Moose), you can write code just fine without it. When you run into a problem, you may dive a bit deeper to understand what’s wrong.
The second question, how to learn Moose, is really not a good fit for Stack Overflow.
Google "The Moose is Flying". You will find all you need there
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With