[Koha-patches] [PATCH] (bug #3193) fix the comtd value in acqui-home.pl

Galen Charlton galen.charlton at liblime.com
Thu May 7 23:51:42 CEST 2009


Hi Nahuel,

2009/5/6 Joe Atzberger <joe.atzberger at liblime.com>:
> On Wed, May 6, 2009 at 6:26 AM, Nahuel ANGELINETTI
> <nahuel.angelinetti at biblibre.com> wrote:
>>
>> +        if ( !$left || $left eq '' ) {
>
> That test is no different than:
> if (!$left)...
>
> That is, the second part of the conditional will never be evaluated true,
> since empty string evaluates to false and "! FALSE" will have already proven
> true on the first part.
>
> You can confirm with:
> perl -e 'my $x = ""; print ($x ? "yes\n" : "no\n");'

I've gone ahead and pushed the patch since it does correct a
discrepancy in the budget display and is useful in HEAD even before
new_acq is available, but Joe's correct that 'if ( !$left || $left eq
'' )' could simply be stated as 'if ( !$left )'.  Please consider
cleaning up this construct in C4/Bookfund.pm and acqui/bookfund.pl.

Regards,

Galen
-- 
Galen Charlton
VP, Research & Development, LibLime
galen.charlton at liblime.com
p: 1-888-564-2457 x709
skype: gmcharlt



More information about the Koha-patches mailing list