Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it "OK" to wrap standard Perl modules with Moose?

Tags:

perl

moose

Many standard modules are all using straight up perl -- problem is these guys arent using Moosey stuff, so I catch myself wrapping them with Moose or reinventing some simple functions in bigger libraries for convenience.

I wondered if there was any general approach to how developers using Moose incorporate other libraries that are non-Moose.

Being new to Perl and Moose I'd like to have a better understanding of how Moose is used in situations like this, or when it is generally preferred to use Moose vs Perl or even MooseX, or some other package, or whether its arbitrary.

Seems like there are different schools of thought, but Perl being as old as it is -- there are too many conflicting sources, so it's hard to navigate to a consistent truth. I'm not sure what to believe!

Anyone have a definitive source they turn to for "modern" usage of perl? Understand I've only been using perl for a month so I'm green to this community.

Updated

I don't want to hurt anybody's feelings by talking about libraries they love in a way they may not appreciate, so I've removed my side commentary about certain libraries Ive used to refocus on the question at hand.

Thanks for your guidance!

like image 488
qodeninja Avatar asked Oct 14 '11 22:10

qodeninja


1 Answers

While I do not know what others do, I would be very reluctant to create myself extra work. I do not see any general need to Moosify a bunch of modules that already work.

If you want to inherit from non-Moose modules, take a look at MooseX::NonMoose.

If the HTML generation cruft in CGI.pm bothers you, you can use CGI::Simple.

like image 166
Sinan Ünür Avatar answered Sep 17 '22 17:09

Sinan Ünür