in reply to Problem regarding storing the values in Hash.
Hi,
@num=('1','1','3','2','4','3','5'); @address=('address1','address1', 'address3','address2', 'address4','ad +dress3', 'address5'); @num = grep (!$uniques{$_}++, @num); # remove the duplicates @address = grep (!$uniques{$_}++, @address); # remove the duplicates foreach $num(@num) { foreach $add(@address) { if ($add=~m#address${num}#) { $hash{$num}=$add; } } } print "\n$_ = $hash{$_}" for sort keys %hash;
|
|---|