close($opts{"to_handle"}); # has been duped, can be closed
}
# Close some inherited filehandles
- close($_) foreach (@{$opts{"close_in_child"}});
+ close($_) foreach (@{$opts{"close_in_child"}});
# Execute the program
exec({ $prog[0] } @prog) or syserr(_g("exec %s"), "@prog");
}
sub set_compression_level {
my ($self, $level) = @_;
error(_g("%s is not a compression level"), $level)
- unless $level =~ /^([1-9]|fast|best)$/;
+ unless $level =~ /^([1-9]|fast|best)$/;
$self->{"compression_level"} = $level;
}
my ($self, $file) = @_;
error("call create first") unless $self->{"tar_input"};
$file = $2 if ($file =~ /^\Q$self->{'cwd'}\E\/(.+)$/); # Relative names
- print { $self->{'tar_input'} } "$file\0" ||
+ print({ $self->{'tar_input'} } "$file\0") ||
syserr(_g("write on tar input"));
}
#
$mode = 0777 & ~umask;
for ($i = 0; $i < 9; $i += 3) {
- $modes_set .= ',' if $i;
- $modes_set .= qw(u g o)[$i/3];
- for ($j = 0; $j < 3; $j++) {
- $modes_set .= $mode & (0400 >> ($i+$j)) ? '+' : '-';
- $modes_set .= qw(r w X)[$j];
- }
+ $modes_set .= ',' if $i;
+ $modes_set .= qw(u g o)[$i/3];
+ for ($j = 0; $j < 3; $j++) {
+ $modes_set .= $mode & (0400 >> ($i+$j)) ? '+' : '-';
+ $modes_set .= qw(r w X)[$j];
+ }
}
system('chmod', '-R', $modes_set, '--', $tmp);
subprocerr("chmod -R $modes_set $tmp") if $?;
sub set_compression_level {
my ($self, $level) = @_;
error(_g("%s is not a compression level"), $level)
- unless $level =~ /^([1-9]|fast|best)$/;
+ unless $level =~ /^([1-9]|fast|best)$/;
$self->{"compression_level"} = $level;
}