#internal method to get file content of this commit my $content = read_file_content($file_name); my @violations = critique({-profile => 'perlcritic.conf'} , \$content); # report violations foreach my $crit (@violations){ print STDERR "[$file_name] " . $crit->to_string . "\tsource: " . $crit->source . "\n"; }