in reply to grep confusion
Your code looks fine. The slashes will not interfere with forming hash keys.
The problem appears to be that the trailing data is making each element of @array unique. If there is no way of distinguishing where a path ends and data starts, you have an intractable problem. Ideally, the data should start with ASCII NUL, which cannot be part of a file name. Then,
If you don't have that luxury, can you characterize what the filename extensions are? Matching those can locate the end of the path for you.my %saw; @out = grep {!$saw{$_}++} map {substr $_, 0, index($_,"\0")} @array;
After Compline,
Zaxo
|
|---|