in reply to Re^4: compare files by words
in thread compare files by words

use List::Util "min";

Yep, I like and use that. But for two values only a simple ternary is more appropriate IMHO. Of course keeping a $total is also fine, interesting and I had thought of it myself. But after all the $bad vs $good one is more symmetric and thus I prefer it. That's just me of course.

Replies are listed 'Best First'.
Re^6: compare files by words
by ysth (Canon) on May 31, 2007 at 19:18 UTC
    I've seen people get that "simple ternary" backwards :) and min reads a lot easier. In a one-liner, I'd use the ternary.

    You could do bad & good and no total and still have the grep do the counting of one or the other. Still not quite symmetric, though.