Subject: | `no Moose` removes Strict |
Date: | Thu, 10 Jun 2010 10:36:15 -0700 |
To: | bug-Moose [...] rt.cpan.org |
From: | "David E. Wheeler" <dwheeler [...] cpan.org> |
If you run this script:
#!/usr/bin/perl -w
package Foo;
use strict;
use Moose;
has something => (is => 'rw', isa => 'Bool' );
no Moose;
#use strict;
sub bar { $h = 'bar'; }
It will succeed. This surprised me. If you uncomment the `use strict` after `no Moose`, it correctly dies with
Global symbol "$h" requires explicit package name at try.pl line 12.
I don't think that `no Moose` should remove strict -- or any other modules or symbols that I've explicitly used/imported (does it remove warnings, for example?). The side-effects are just too surprising.
Thanks,
David