Re: [PATCH] git-send-email.perl - Fix 550 EHLO argument does not match calling host

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

 



Junio C Hamano <gitster@xxxxxxxxx> writes:

> Jari Aalto <jari.aalto@xxxxxxxxx> writes:
>
>> +sub maildomain_net
>> +{
>> +	my $maildomain;
>> +	eval "use Net::Domain";
>> +
>> +	unless ($@) {
>> +		eval "use Net::Domain";
>> +		unless ($@) {
>
> Sorry, but I don't understand the reason why you need to check the same
> thing twice.  The original you borrowed from seems to be much cleanly
> written; it essentially boils down to:
>
>     if (eval "require Net::Domain") {
>         my $domain = Net::Domain::Domainname();
>         ...
>     }
>
> without need for separate "unless ($@)", nor doubly nested construct.

Code written like that inside if-statements is pretty bad IMHO. It is
very debuggable, whereas using variables would be:

    >> +	eval "use Net::Domain";
    >> +
                Debug("use Net::Domain", $@);
    >> +	unless ($@) {


But that's my code to maintain, I'll do what is needed.
Jari

--
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]