in reply to Problem regarding storing the values in Hash.

Let the hash take care of duplicate key removal:
my %hash; foreach my $i (0 .. $#num) { my $key = $num[$i]; my $value = $address[$i]; $hash{$key} = $value; } print "$_ => $hash{$_}\n" for keys %hash;
It's not clear to me from your problem description that this is correct, but I'll submit it as a "talking point".

Replies are listed 'Best First'.
Re^2: Problem regarding storing the values in Hash.
by jdalbec (Deacon) on Feb 19, 2005 at 15:59 UTC
    ObGolf:
    @num = (1, 1, 3, 2, 4, 3, 5); @address = (address1, address1, address3, address2, address4, address3 +, address5 ); my %hash; @hash{@num}=@address; print "$_ => $hash{$_}\n" for sort {$a <=> $b} keys %hash;
    I added the sort since it looks like the OP wanted it.