"especially since OOP in perl is so raw and different from what I've encountered in other languages"
That's an interesting thing to say. It's certainly a lot rawer (is that a word?) than Java or PHP, or many other languages. But Python and Perl's OO systems are actually fairly close to each other:
- Methods are just functions which take an object as the first parameter.
- Lack of true private methods; just use the convention of an underscore prefix. (Though Python also has name mangling for double underscores.)
- Multiple inheritance and a default of depth-first mro.
- Instances have slots where the class can store arbitrary data, and which do not need to be declared beforehand. (Or at least, this is true in Perl if the instances are blessed hashrefs, as is very common.)
Moose provides a much more organised way of building classes in Perl if you're fed up of doing it "raw". IMHO, it's more powerful than the OO of pretty much any other mainstream programming language. Though it's just a layer over Perl's built-in crazy way of doing OO, so you can always dip into that as needed.
package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.