in reply to Re: Summing repeated counts for items stored in separate file
in thread Summing repeated counts for items stored in separate file

Thanks. Nice looking code.

Why readline(*KEYS) instead of <KEYS> ?

  • Comment on Re^2: Summing repeated counts for items stored in separate file

Replies are listed 'Best First'.
Re^3: Summing repeated counts for items stored in separate file
by mjscott2702 (Pilgrim) on Jul 29, 2007 at 23:41 UTC
    The readline function is what is used "behind the scenes" to implement the <> operator, and takes a typeglob, hence *KEYS instead of <KEYS>;

    Keeping track of the min, max, total and count (for average value) may be faster than using the List utilities described earlier, or at least should take less memory, since you only need to keep track of a few values for each key. Although the utilities in question are extremely fast, you might need an array of thousands of values for each key, growing in size as you process the files.
      You said:
      The readline function is what is used "behind the scenes" to implement the <> operator, and takes a typeglob, hence *KEYS instead of <KEYS>;
      OK, I follow you, but what's the benefit of using readline instead of simply <>?