kod Śledź nie jest akceptowana przez krytyk dotkliwości 4:Perl Krytyk: Comma wykorzystywane do jednostkowego sprawozdania
return {
'debug' => $debug,
'identifier' => $identifier
};
otrzymuję ten błąd:
# Perl::Critic found these violations in "filename.pl":
# Comma used to separate statements at line 356, column 3. See pages 68,71 of PBP. (Severity: 4)
ale ten kod jest akceptowany bez uwagą:
my $result = {
'debug' => $debug,
'identifier' => $identifier
};
return $result;
Czy lepiej napisać zwrot za pomocą zmiennej tymczasowej, czy też krytyka jest niewłaściwa w wykrywaniu a Comma used to separate statements
podczas gdy ja tylko buduję i zwracam haszysz?
Pomógłbyś, jeśli napiszesz zwrot '({....});'? – Ingo
Nie mogę odtworzyć tego zachowania. Jakiej wersji "Perl :: Critic" używasz? – Borodin
Nie mogę odtworzyć problemu: 'perlcritic --brutal -s ValuesAndExpressions :: ProhibitCommaSeparatedStatements so9110962.plso9110962.pl source OK' Być może ulepszyć PPI i Perl :: Critic? – daxim