Re: [PATCH 3/3] send-email: use the three-arg form of open in recipients_cmd

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Junio C Hamano wrote:

>               we cannot rewrite it to
>
> 	open my $fh, "-|", $cmd, $file;
>
> for extra safety.  At least, by using this in the three-arg form:
>
> 	open my $fh, "-|", "$cmd \Q$file\E";
>
> we can silence Perlcritique, even though we do not gain much safety
> by doing so.

Yeah, I think this is the right thing to do.

This means that if some later code refactoring parses $tocmd once and
passes an array around, it would be easy to change this to

	open my $fh, "-|", @$cmd, $file;

and there would be no temptation to do something involving pasting
@$cmd back together into a single string.  Of course such a
refactoring is not very likely, but that kind of thing is a good
reason to prefer this style in general.

So for what it's worth, I like this patch.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]