In my last question @Borodin commented my question with:
You should start by removing Modern::Perl and namespace::sweep. Modules that behave as pragma should be avoided.
I'm confused a bit, because:
- in the LATEST Moose BestPractices manual recommending to use
namespace::autoclean
.
The use namespace::autoclean bit is simply good code hygiene, as it removes imported symbols from your class's namespace at the end of your package's compile cycle, including Moose keywords. Once the class has been built, these keywords are not needed. (This is preferred to placing no Moose at the end of your package).
In the Book Intermediate perl
recommending to use the namespace::autoclean
too.
Yes, I'm used the instead of the autoclean
the sweep
module - because again from the doccu
This pragma was written to address some problems with the excellent namespace::autoclean. In particular, namespace::autoclean will remove special symbols that are installed by overload, so you can't use namespace::autoclean on objects that overload Perl operators.
... ...
In most cases, namespace::sweep should work as a drop-in replacement for namespace::autoclean. Upon release, this pragma passes all of namespace::autoclean's tests, in addition to its own.
And because I'm an perl beginner, i'm really confused. For me, when i reading: this module addressing some problems of another module - mean: use this one.
'Manual (where from I should learn) says "use it" and expert from stackoverflow teling: don't use it.
So please, can someone explain me:
- it is correct to use
namespace::sweep
or I should usenamespace::autoclean
or none of them? - if none, why the BestPractices recommends it?
For the `ModernPerl'. Sure, I'm probably don't understand deeply and "exactly" what is does. What i know, (again from it's doccu)
This enables the strict and warnings pragmas, as well as all of the features available in Perl 5.10. It also enables C3 method resolution order as documented in perldoc mro and loads IO::File and IO::Handle so that you may call methods on filehandles. In the future, it may include additional core modules and pragmas.
Sure, don't deeply understand to mro
, only think it is an answer to the "deadly diamond of death" problem in cases of multiple inheritance.
Up to today, i was really happy with it, because it is shorting for me the needed pragmas:
use strict;
use warnings;
use feature 'say';
So, what is a "status" of the "Modern::Perl" (and other similar cpanm modules)? Allowed to use, or not?