I want to write a perl program which reads the file and extracts the dates in it. However if a date passes more than one times I will print it only once. For example:
On 01/10/2011 I went home. On 02/02/2012, I
went to my school. On 02/02/2012, I went
to London.
The output should be:
01/10/2011
02/02/2012
I can do it by adding the dates to an array and control it in every time I read an new date. But I am asking for a more efficient way. Is there a logical way to do it? or any data structure in perl?