cnfsstat -a warns about uninitialized value for new buffer

Julien ÉLIE julien at trigofacile.com
Sun Oct 24 17:54:18 UTC 2010


> Suggestion:
>
> Buffer BUFF09, size:  2.00 GBytes, position:  80.0 kBytes  0.00 cycles
>   Created: 2010-10-20 18:29:10,    0 days,  0:09:33 ago
>   No oldest article
>
> and of course the usual output "Newest"/"Oldest" when $oldart exists.

The code then looks like:

    my ($when, $ago) = &make_time($update);
    if (defined $oldart || not $opt_a) {
        print "  Newest: $when, $ago ago\n";
    } else {
        print "  Created: $when, $ago ago\n";
    }

    if ($opt_a) {
        if (defined $oldart) {
            my ($when, $ago) = &make_time($oldart);
            print "  Oldest: $when, $ago ago\n";
        } else {
            print "  No oldest article\n";
        }
    }



(The previous suggestion was not right -- I did not take into
account the fact that $oldart was undefined when $opt_a is unset.)

-- 
Julien ÉLIE

« Si Dieu n'est pas marié, pourquoi parle-t-on de sa grande Clémence ? »
  (Raymond Devos) 




More information about the inn-workers mailing list