To make Perl Critic shut up, but do no real good at all, just modify the code to:
open(my $PIPE_FROM_FREESPCHK, "-|", $cmdline)
|| zdie($MSG_PASSTHRU, "Error checking free space of file system.");
Note however that this is absolutely no better in any regard whatsoever from the far more obvious:
open(my $PIPE_FROM_FREESPCHK, "$cmdline |")
|| zdie($MSG_PASSTHRU, "Error checking free space of file system.");
Because you are not separating out your tokens for calling exec
directly. That would look more like this:
open(my $PIPE_FROM_FREESPCHK, "-|", $cmd_name, @cmd_args)
|| zdie($MSG_PASSTHRU, "Error checking free space of file system.");
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 just df
, then you don’t.
$cmdline
exactly? Is it a file or something else? – Dhaulagiri## no critic
is all you need to fix this and all the rest of the nattering nabobs of negativity. – Nyhagen