Skip to content

Commit 3e6934f

Browse files
damshaarg
authored andcommitted
remove importing strictures in caller, but suggest it in synopsis and doc
1 parent acc516b commit 3e6934f

File tree

4 files changed

+16
-82
lines changed

4 files changed

+16
-82
lines changed

Makefile.PL

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ my %META = (
2727
'Module::Runtime' => 0.014, # for RT#86394
2828
'Role::Tiny' => 1.003004,
2929
'Devel::GlobalDestruction' => 0.11, # for RT#78617
30-
'Import::Into' => 1.002,
3130
'Scalar::Util' => 0,
3231
'perl' => 5.006,
3332
'Exporter' => 5.57, # Import 'import'

lib/Moo.pm

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package Moo;
22

33
use strictures 1;
44
use Moo::_Utils;
5-
use Import::Into;
65

76
our $VERSION = '1.007000';
87
$VERSION = eval $VERSION;
@@ -21,7 +20,10 @@ sub import {
2120
my $target = caller;
2221
my $class = shift;
2322
_set_loaded(caller);
24-
strictures->import::into(1);
23+
24+
strict->import;
25+
warnings->import;
26+
2527
if ($INC{'Role/Tiny.pm'} and Role::Tiny->is_role($target)) {
2628
die "Cannot import Moo into a role";
2729
}
@@ -242,6 +244,7 @@ Moo - Minimalist Object Orientation (with Moose compatibility)
242244
package Cat::Food;
243245
244246
use Moo;
247+
use strictures 1;
245248
use namespace::clean;
246249
247250
sub feed_lion {
@@ -885,22 +888,19 @@ C<BUILDARGS> is not triggered if your class does not have any attributes.
885888
Without attributes, C<BUILDARGS> return value would be ignored, so we just
886889
skip calling the method instead.
887890
888-
Handling of warnings: when you C<use Moo> we enable FATAL warnings, and some
889-
several extra pragmas when used in development: L<indirect>,
890-
L<multidimensional>, and L<bareword::filehandles>. See the L<strictures>
891-
documentation for the details on this.
892-
893-
A similar invocation for L<Moose> would be:
894-
895-
use Moose;
896-
use warnings FATAL => "all";
891+
Handling of warnings: when you C<use Moo> we enable strict and warnings, in a
892+
similar way to Moose. The authors recommend the use of C<strictures>, which
893+
enables FATAL warnings, and some several extra pragmas when used in
894+
development: L<indirect>, L<multidimensional>, and L<bareword::filehandles>.
895+
See the L<strictures> documentation for the details on this.
897896
898897
Additionally, L<Moo> supports a set of attribute option shortcuts intended to
899898
reduce common boilerplate. The set of shortcuts is the same as in the L<Moose>
900899
module L<MooseX::AttributeShortcuts> as of its version 0.009+. So if you:
901900
902901
package MyClass;
903902
use Moo;
903+
use strictures 1;
904904
905905
The nearest L<Moose> invocation would be:
906906

lib/Moo/Role.pm

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use strictures 1;
44
use Moo::_Utils;
55
use Role::Tiny ();
66
our @ISA = qw(Role::Tiny);
7-
use Import::Into;
87

98
our $VERSION = '1.007000';
109
$VERSION = eval $VERSION;
@@ -31,8 +30,10 @@ sub _install_tracked {
3130
sub import {
3231
my $target = caller;
3332
my ($me) = @_;
33+
3434
_set_loaded(caller);
35-
strictures->import::into(1);
35+
strict->import;
36+
warnings->import;
3637
if ($Moo::MAKERS{$target} and $Moo::MAKERS{$target}{is_class}) {
3738
die "Cannot import Moo::Role into a Moo class";
3839
}
@@ -421,6 +422,7 @@ Moo::Role - Minimal Object Orientation support for Roles
421422
package My::Role;
422423
423424
use Moo::Role;
425+
use strictures 1;
424426
425427
sub foo { ... }
426428
@@ -437,6 +439,7 @@ And elsewhere:
437439
package Some::Class;
438440
439441
use Moo;
442+
use strictures 1;
440443
441444
# bar gets imported, but not foo
442445
with('My::Role');

xt/strictures.t

Lines changed: 0 additions & 68 deletions
This file was deleted.

0 commit comments

Comments
 (0)