my %hash; open (FILE,"abc.txt"); while () { chomp; my ($key,$val) = split '\|'; print $hash{$val}; }