perlcritic: make all open() calls three-argument
Two-argument calls end up parsing the second argument to guess what should happen, three-arg parses ... less?
This commit is contained in:
@ -14,7 +14,7 @@ sub process {
|
||||
|
||||
my $fh = IO::Handle->new();
|
||||
|
||||
open $fh, "nix-store --export `nix-store -qR @storePaths` | gzip |";
|
||||
open($fh, "-|", "nix-store --export `nix-store -qR @storePaths` | gzip");
|
||||
|
||||
$c->response->body($fh);
|
||||
|
||||
|
@ -17,13 +17,13 @@ sub process {
|
||||
my $tail = int($c->stash->{tail} // "0");
|
||||
|
||||
if ($logPath =~ /\.bz2$/) {
|
||||
my $doTail = $tail ? " tail -n '$tail' |" : "";
|
||||
open $fh, "bzip2 -dc < '$logPath' | $doTail" or die;
|
||||
my $doTail = $tail ? "| tail -n '$tail'" : "";
|
||||
open($fh, "-|", "bzip2 -dc < '$logPath' $doTail") or die;
|
||||
} else {
|
||||
if ($tail) {
|
||||
open $fh, "tail -n '$tail' '$logPath' |" or die;
|
||||
open($fh, "-|", "tail -n '$tail' '$logPath'") or die;
|
||||
} else {
|
||||
open $fh, "<$logPath" or die;
|
||||
open($fh, "<", $logPath) or die;
|
||||
}
|
||||
}
|
||||
binmode($fh);
|
||||
|
@ -16,7 +16,7 @@ sub process {
|
||||
|
||||
my $fh = IO::Handle->new();
|
||||
|
||||
open $fh, "nix-store --dump '$storePath' | pixz -0 $pParam |";
|
||||
open($fh, "-|", "nix-store --dump '$storePath' | pixz -0 $pParam");
|
||||
|
||||
setCacheHeaders($c, 365 * 24 * 60 * 60);
|
||||
|
||||
|
Reference in New Issue
Block a user