in reply to Re^2: remove duplicates with hash and grep
in thread remove duplicates with hash and grep

... now getting the list but it has not removed the duplicates.
...
    my @array = $1;

On every iteration through the while-loop, this statement creates a new array and initializes it with a single element: the string that was captured to $1. This string is, of course, unique!