Use Hashes for the First Time
A hash is a good way to keep track of whether you've done something before.
Embrace the ... unless $seen{$item}++ notation:
%seen = (); foreach $item (genlist()) { func($item) unless $seen{$item}++; }
< Or
Use Hashes of Records, not Parallel Arrays >
Table of Contents
|
Page 15
YAPC 19101
, June 2001
Perl Idioms
Nathan Torkington