Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re: Perlcritic and checking file modesby kcott (Archbishop) |
on Jul 08, 2015 at 16:43 UTC ( [id://1133744]=note: print w/replies, xml ) | Need Help?? |
G'day Neil, To be honest, that does sound like a typo somewhere in your code using oct. You haven't shown that code so please confirm that with these lines:
Test 3 passes and you get those 2 perlcritic warnings. But, when changing those lines to:
Test 3 fails but you get those 0 perlcritic warnings. And do note that I've removed the leading zeros for the oct arguments: oct(0777) and oct(022) will still generate the perlcritic warnings. If you believe you have checked closely and there's no typos, can you provide a short, self-contained script to reproduce the problem that we can run. I did actually try to reproduce it with the script I posted in response to your last question regarding this "Testing for group or world writable files". Without oct, I got 4 passes and 4 perlcritic warnings; with oct, I got 4 passes and 0 perlcritic warnings. Personally, although there's much about PBP I like, this isn't one of them: you're working with modes, there's a variable called $mode (so that's somewhat obvious), modes are in octal, why complain about octal numbers. If you're of the same view, just turn the warnings off (in the smallest scope possible):
-- Ken
In Section
Seekers of Perl Wisdom
|
|