in reply to Re: use utf8 pragma with moo
in thread use utf8 pragma with moo

Thank you very much for "warn Dumper sort keys %INC" - this is brilliant.

The problem with namespace:

use utf8; use feature qw(signatures); no warnings qw(experimental::signatures); use Moo; use namespace::clean; sub BUILD($self) { $self->_set_count(1); }

An error: "The signatures feature is experimental ..."

Should I place no warnings after namespace::clean or there are other solutions? Maybe with namespace::clean -except?

Replies are listed 'Best First'.
Re^3: use utf8 pragma with moo
by Corion (Patriarch) on Jan 15, 2022 at 08:50 UTC

    The "problem" with Moo is that it re-enables all warnings that you previously disabled.

    So a solution is to disable warnings after the use Moo; line:

    use utf8; use feature qw(signatures); use Moo; no warnings qw(experimental::signatures);
      The "problem" with Moo is that it re-enables all warnings that you previously disabled

      That's odd ... why has the right to "Do What I Don't Mean" been bestowed upon Moo, when that sort of thing is generally frowned upon ?

      Thankfully, I don't use Moo and have no interest in it.
      However, I have just installed it to verify that it actually has this most unperlish capability ... and it does !!
      What's the spin that validates this ?

      Cheers,
      Rob

        I think the spin is that this is an improvement over Moo v1, which made all warnings fatal...

        I like Moo for its simplicity and disable all unwanted warnings (that is, experimental::signatures afterwards), but yes, it's inconvenient.

      Huh! Thanks for enlightenment!