rduke15 has asked for the wisdom of the Perl Monks concerning the following question:
I have several scripts which it would seem wise to turn into modules. Unfortunately, even though I have been using Perl for a long time, OO concepts still tend to feel unfamiliar to me.
I could certainly just follow perootut and perlobj, but I understand that learning Moo or something similar would make it much easier in the end, by delegating a lot of boilerplate code to such a constructor module. If only I could understand it's basics, and know where to look for simple examples...
Basically, what I do is read a file into one or more hashes, manipulate the data and write the file back.
My current interest is mainly in files like edit lists (like Avid ALE files) and subtitles of various formats (including binary formats, for which there is nothing in CPAN currently). Doing the whole thing in a simple Perl script is pretty straightforward, but I'm sick of copy/pasting chunks of code from previous scripts, and would like to learn doing it the "right way" with various modules for the various formats.
What do the wise monks think? Where can I find examples to get me started? Or am I overengineering this, and would a plain module without /Mo.*/ or /Class::.*/ be much simpler?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: tutorials / examples to start using Moo (or Class::Tiny, or...?)
by CountZero (Bishop) on Jul 21, 2015 at 17:52 UTC | |
by Laurent_R (Canon) on Jul 21, 2015 at 18:54 UTC | |
|
Re: tutorials / examples to start using Moo (or Class::Tiny, or...?)
by neilwatson (Priest) on Jul 21, 2015 at 17:41 UTC | |
|
Re: tutorials / examples to start using Moo (or Class::Tiny, or...?)
by 1nickt (Canon) on Jul 22, 2015 at 03:31 UTC | |
|
Re: tutorials / examples to start using Moo (or Class::Tiny, or...?)
by karlgoethebier (Abbot) on Jul 21, 2015 at 19:52 UTC | |
|
Re: tutorials / examples to start using Moo (or Class::Tiny, or...?)
by gnosti (Chaplain) on Jul 23, 2015 at 01:50 UTC |