Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Find duplicate elements from an array

by PeterPeiGuo (Hermit)
on Nov 22, 2010 at 02:36 UTC ( [id://872865] : note . print w/replies, xml ) Need Help??


in reply to Find duplicate elements from an array

You have to show effort. Here is some tips:

Hash is perfect in this case. Use the "entry" as the key, and put the page numbers in an array. So we are talking about a hash of arrays here.

Traverse through the file line by line, and use a simple regex to separate 'entry" from the page number.

Peter (Guo) Pei

  • Comment on Re: Find duplicate elements from an array