in reply to Can a hash name have the same value twice.

If you want to put all of the the values for each key together, then give this a go.(I'm Assuming the file is in the above format.)
open (FILE,"c:/file.txt"); %hash=(); while (<FILE>) {chomp; split /:/; if ($hash{$_[0]}){$hash{$_[0]}.=",$_[1]";} else {$hash{$_[0]}=$_[1];} }

Replies are listed 'Best First'.
Re: Answer: Can a hash name have the same value twice.
by Anonymous Monk on Jan 22, 2008 at 16:35 UTC
    HI, I'm not able to execute the script u have written. I have a requirement like this: original file: 38881,408 38884,596 38884,597 38884,607 38884,608 38884,609 38884,615 output expected: 38881:408 38884:596,597,607,608,609,615 Could you plz. help me to get this output done