in reply to finding unique items in an array, from a text file
Since someone's already fixed the OP's code to do what was intended, I'll put in how I might have written this.
my %u; print grep !$u{$_}++, <>;
Unlike another short solution posted elsewhere, this keeps the lines in their original order while filtering out the duplicates.
|
|---|