Also see Moose::Manual::Delta for more details of, and workarounds
for, noteworthy changes.
+ [NEW FEATURES]
+
+ * We no longer unimport strict and warnings when Moose, Moose::Role, or
+ Moose::Exporter are unimported. Doing this was broken if the user
+ explicitly loaded strict and warnings themself, and the results could be
+ generally surprising. We decided that it was best to err on the side of
+ safety and leave these on. Reported by David Wheeler. RT #58310. (Dave
+ Rolsky)
+
[BUG FIXES]
* Accessors will now not be inlined if the instance metaclass isn't
it documented here, or think we missed an important feature, please
send us a patch.
+=head1 1.09
+
+=item C<no Moose>, C<no Moose::Role>, and C<no Moose::Exporter> no longer unimport strict and warnings
+
+This change was made in 1.05, and has now been reverted. We don't know if the
+user has explicitly loaded strict or warnings outside on their own, and
+unimporting them is just broken in that case.
+
=head1 1.05
=over 4
::ok($warn, '... got a warning');
::like($warn, qr/Argument \"hello\" isn\'t numeric in addition \(\+\)/, '.. and it is the right warning');
}
-
- no Moose;
- undef $@;
- eval '$foo = 5;';
- ::ok(!$@, "... no error after no Moose");
-
- {
- my $warn;
- local $SIG{__WARN__} = sub { $warn = $_[0] };
-
- ::ok(!$warn, '... no warning yet');
-
- eval 'my $bar = 1 + "hello"';
-
- ::ok(!$warn, '... still no warning');
- }
}
# and for roles ...
::ok($warn, '... got a warning');
::like($warn, qr/Argument \"hello\" isn\'t numeric in addition \(\+\)/, '.. and it is the right warning');
}
-
- no Moose::Role;
- undef $@;
- eval '$foo = 5;';
- ::ok(!$@, "... no error after no Moose::Role");
-
- {
- my $warn;
- local $SIG{__WARN__} = sub { $warn = $_[0] };
-
- ::ok(!$warn, '... no warning yet');
-
- eval 'my $bar = 1 + "hello"';
-
- ::ok(!$warn, '... still no warning');
- }
}
# and for exporters
package Bar;
use Moose::Exporter;
- eval '$foo2 = 5;';
+ eval '$foo = 5;';
::ok($@, '... got an error because strict is on');
- ::like($@, qr/Global symbol \"\$foo2\" requires explicit package name at/, '... got the right error');
+ ::like($@, qr/Global symbol \"\$foo\" requires explicit package name at/, '... got the right error');
{
my $warn;
::ok($warn, '... got a warning');
::like($warn, qr/Argument \"hello\" isn\'t numeric in addition \(\+\)/, '.. and it is the right warning');
}
-
- no Moose::Exporter;
- undef $@;
- eval '$foo = 5;';
- ::ok(!$@, "... no error after no Moose::Exporter");
-
- {
- my $warn;
- local $SIG{__WARN__} = sub { $warn = $_[0] };
-
- ::ok(!$warn, '... no warning yet');
-
- eval 'my $bar = 1 + "hello"';
-
- ::ok(!$warn, '... still no warning');
- }
}
done_testing;