开发者

Does anyone have experience with Perl5i?

开发者 https://www.devze.com 2023-04-07 02:32 出处:网络
I occasionally see Perl5i being mentioned. It looks great and make things easier. Some questions: Is this module compatible with other modules, e.g. Dancer, Mojolicious, XML::RSS, etc.?

I occasionally see Perl5i being mentioned. It looks great and make things easier. Some questions:

  1. Is this module compatible with other modules, e.g. Dancer, Mojolicious, XML::RSS, etc.?

  2. It it compatible with Moose, or does it have better OO features?

  3. It wraps the best CPAN modules, if my scri开发者_JAVA百科pt uses these…

    use strict;
    use utf8::all;
    use XML::RSS::JavaScript;
    use DateTime::Format::Mail;
    

    … should I just replace it with:

    use perl5i::2;
    use XML::RSS::JavaScript;
    use DateTime::Format::Mail;
    

Any experience, good and bad, please share.


I'm the primary author of perl5i.

1) perl5i is compatible with other modules. If you find a conflict, let us know. http://github.com/schwern/perl5i/issues

2) Yes, it is compatible with Moose and Mouse. It does not have ambitions to reinvent those wheels. Its contribution to OO is autoboxing, where non-objects can have methods called on them like $string->trim.

3) In general, you can safely use perl5i with existing code. However, it does do some small backwards incompatible changes, generally to bits of Perl that don't make sense anyway. The biggest things to look out for are 1) file operations (like open) now throw exceptions on failure and 2) utf8::all changes how non text files are read.

My experiences with perl5i are biased. I can say the biggest negatives about perl5i are 1) sometimes there are bugs and its lexical effects leak out of scope 2) the dependency chain is pretty big and 3) some of those dependencies have issues on Windows. The positive sides are how much autoboxing and built-in exceptions change how one writes Perl.

There is a FAQ and I give a talk about perl5i.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号