in reply to Re^4: A Few Questions About IO::File
in thread A Few Questions About IO::File

"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:

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

Replies are listed 'Best First'.
Re^6: A Few Questions About IO::File
by rpetrelli (Novice) on Mar 19, 2013 at 00:45 UTC

    I think I read somewhere that Larry wall borrowed the object system directly from python. It's evident by the way both languanges need to unpack the invocant $self manually.

    While they are similar in concept, in perl I have to do a lot of manual works and boilerplates just to create a class with a bunch of accessors and mutators methods.

    And I am familiar with Moose, since my original reason to learn perl was to use the Catalyst framework which uses Moose (roles and Moose's type checking ability is da bomb). But I somehow got sidetracked and currently learning the guts of perl's object system. It's all good, fortunately since this is only a side project and I'm not hard pressed on time.