in reply to Sorting/Cleansing a Duplicate File

Hi,

Your code looks OK to me, but you don't really need this line:

if (!exists $countries{$_})
in your code, the hash will remove duplicates without that.

Concerning your other question, this is not exactly a code checker, but the use of the:

use warnings;
pragma will definitely help you finding a number of common errors and possibly dangerous or deprecated constructs.

Replies are listed 'Best First'.
Re^2: Sorting/Cleansing a Duplicate File
by perlron (Pilgrim) on Oct 25, 2014 at 14:43 UTC
    thanks . u mean the value will get re-assigned every time ? i wil check this.. thats a good one.!
    Do not wait to strike when the iron is hot! Make it hot by striking - WB Yeats
      Yes, it will be reassigned every time, but you don't care, do you? And at the end, the keys of your hash will be unique.