I have a script and I am trying to elimate bad practices using perlcritic.
One line I have is as follows:
open(my($FREESPCHK), $cmdline ) || &zdie($MSG_PASSTHRU,"Error checking free space of file system.");
This gives this error:
Two-argument “open” used at line xxx, column x. See page 207 of PBP. (Severity: 5)
Any ideas on how to fix it?
To make Perl Critic shut up, but do no real good at all, just modify the code to:
Note however that this is absolutely no better in any regard whatsoever from the far more obvious:
Because you are not separating out your tokens for calling
execdirectly. That would look more like this:The question is whether you are running a shell command or just exec’ing something. If your free check is something like
df . 2>/dev/null | awk ...., then you need the full shell. If it is justdf, then you don’t.