Re: Help getting rid of duplicate entires in a datafile

2001-02-19 Thread Dirk Bremer
Gary, In your code example: > foreach (@allheadlines) > { > # if there's a match on a line, set $found to > # empty >if ($_ =~ m/$check_for/i) { print "Dup: $_\n"; $found = ""; } > } You never set $found to any other value other than "", i.e. $found always

Re: Help getting rid of duplicate entires in a datafile

2001-02-19 Thread SCOTT_SISSON
A quick suggestion is to put the headlines in a hash and subsequently check if they exist, i.e. something like the following: if ( not exists $headlinelist{$headline} ) { &do _your_stuff; }