本文介绍了是“OK​​"吗?用Moose 包装标准Perl 模块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

许多标准模块都直接使用 perl —— 问题是这些人不使用 Moosey 的东西,所以我发现自己用 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.

我想知道对于使用 Moose 的开发人员如何合并非 Moose 的其他库,是否有任何通用方法.

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

作为 Perl 和 Moose 的新手,我想更好地了解 Moose 在这种情况下的使用方式,或者当通常更喜欢使用 Moose vs Perl 甚至 MooseX 或其他一些软件包时,或者是否它的任意性.

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.

似乎有不同的思想流派,但 Perl 和它一样古老——有太多相互矛盾的来源,所以很难找到一致的事实.我不知道该相信什么!

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!

任何人都有他们求助于 perl 的现代"用法的明确来源?了解我只使用 perl 一个月,所以我对这个社区很满意.

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.

更新

我不想通过以他们可能不喜欢的方式谈论他们喜欢的图书馆来伤害任何人的感情,所以我删除了我曾经用来重新关注手头问题的某些图书馆的附带评论.

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.

感谢您的指导!

推荐答案

虽然我不知道别人是怎么做的,但我非常不愿意为自己创造额外的工作.我不认为有任何一般需要 Moosify 一堆已经工作的模块.

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.

如果您想从非 Moose 模块继承,请查看 MooseX::NonMoose.

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

如果 CGI.pm 中的 HTML 生成问题困扰您,您可以使用 CGI::Simple.

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

这篇关于是“OK​​"吗?用Moose 包装标准Perl 模块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-22 11:34