Next Tricks of the Wizards 134

Selecting n Different Things

        while (keys %h < $n) {
          $h{select_thing()}++;
        }
        @things = keys %h;


Next Copyright © 2003 M. J. Dominus