Hi
Trying to write a perl script that does this:
-Reads in a list of values from a txt file and splits into an array (filenames)
-Does a find on a directory structure and sorts the results into last modified order (It then processes each filename in a subroutine)
-Looks at the contents of the array... (foreach?) If the filename from the previous step is NOT in the array, it does processing. If it IS there, it does nothing and the sub exits (i.e. next find result is evaluated).
Now steps one and two are fine, but step 3 I cannot get working... THis is because if I use a simple foreach, I am going to end up processing the same data many times (for example- if the entry is at the 5th position in the array, I am going to process the file 4 times before I realise it's there).
I don't want to use a hash because the order in which the values are in the array is significant, and I also need to trim the array before writing it back to the file (i.e. so I don't end up with zillions of useless entries after a few weeks).
Can anyone help?
Thanks
Trying to write a perl script that does this:
-Reads in a list of values from a txt file and splits into an array (filenames)
-Does a find on a directory structure and sorts the results into last modified order (It then processes each filename in a subroutine)
-Looks at the contents of the array... (foreach?) If the filename from the previous step is NOT in the array, it does processing. If it IS there, it does nothing and the sub exits (i.e. next find result is evaluated).
Now steps one and two are fine, but step 3 I cannot get working... THis is because if I use a simple foreach, I am going to end up processing the same data many times (for example- if the entry is at the 5th position in the array, I am going to process the file 4 times before I realise it's there).
I don't want to use a hash because the order in which the values are in the array is significant, and I also need to trim the array before writing it back to the file (i.e. so I don't end up with zillions of useless entries after a few weeks).
Can anyone help?
Thanks