M
Magnus
Hi!
How do I only put unique element into a HoL? I do not want to add
$element into HoL if it is already there. Here is my program so far,
but this version adds every element for a $hashkey.
Thanks in advance!
Magnus
while(<>)
{
chomp;
my @line = split(/;/);
# Set hashkey to $line[1] but only first 10 digits
my $hashkey = substr($line[1], 0, 9);
my $element = $line[3];
push @{ $HoL{$hashkey} }, $element;
}
How do I only put unique element into a HoL? I do not want to add
$element into HoL if it is already there. Here is my program so far,
but this version adds every element for a $hashkey.
Thanks in advance!
Magnus
while(<>)
{
chomp;
my @line = split(/;/);
# Set hashkey to $line[1] but only first 10 digits
my $hashkey = substr($line[1], 0, 9);
my $element = $line[3];
push @{ $HoL{$hashkey} }, $element;
}