If C<$replace> is true, then the rule will replace the first rule in the list that is a subclass or that consumes the role denoted by the target.
All the subsequent rules in the list that inherit or consume the target will be removed.
+Returns true if and only if an existent rule was replaced.
+
=cut
sub insert {
my $overwrite = $args{overwrite};
my $replace = $args{replace};
- my $target = $rule->target;
- my $is_role = $rule->is_role;
-
if ($replace) {
my (@remove, $replaced);
return 1 if $replaced;
} else { # Replace only an existent rule
+ my $target = $rule->target;
for my $i (0 .. $#$list) {
my $old_target = $list->[$i]->target;