in reply to find unique values from a file by comparing two columns

Hi sreeragtk86,
If you store values as hash keys then the hash itself will keep the uniqness.
#!/usr/bin/perl -w use strict; use Data::Dumper; my %hash; while (<DATA>) { chomp; my @row = split(':'); $hash{$row[2]}->{$row[1]} = 1; } print Dumper( \%hash ) . "\n"; __DATA__ D1:111:92111 D2:112:92111 D3:111:92111 D4:112:92111 D5:111:90222 D6:112:90222 D7:111:90222 D8:112:90222
Regards