Slide 89
Slide 89 text
1FSM$SJUJD1PMJDZ.PEVMFT3FRVJSF&OE8JUI0OF
sub violates {
my ( $self, $elem, $doc ) = @_;
# Last statement should be just "1;"
my @significant = grep { _is_code($_) }
$doc->schildren();
my $match = $significant[-1];
return if !$match;
return if ((ref $match) eq 'PPI::Statement' &&
$match =~ m{\A 1 \s* ; \z}xms );
# Must be a violation...
return $self->violation( $DESC, $EXPL, $match );
}
148݄30༵