Perl-Critic - Beginners observations

Posted on Tue Jan 2 07:16:08 2007 by owencook
Beginners observations
I am just beginning to use Perl::Critic so my comments may reflect more than my lack of understanding of the book ==============================================================================================
if ( open(my $LSTAC, "$lstac -m|" ) ) {
Two-argument "open" used at line 110, column 10. See page 207 of PBP. (Severity: 5) changed to
if ( open(my $LSTAC,"<", "$lstac -m|" ) ) {
But the functionality of the script failed. Comment: Piping ( | ) and direction "<" seem to conflict? ==============================================================================================
foreach $_ (@ma_list) { print; print "$space" }
Loop iterator is not lexical at line 219, column 5. See page 108 of PBP. (Severity: 5) changed to
foreach my $_ (@ma_list) { print; print "$space" }
Then running 'perl -c ...' Can't use global $_ in "my" at finger.cgi line 219, near "my $_ " Comment: Haven't looked through the Perl::Critic code, but maybe a foreach followed by a $_ could be ignored
==============================================================================================
Direct Responses: 3945 | 3946 | Write a response