in reply to Re: Database Rows into Perl Hash
in thread Database Rows into Perl Hash
Hello vishi,
Is there any other way to do it...
Yes! The simplest way is to replace this line in the original:
$hash{ $comp } = $bug_num;
with this:
push @{ $hash{ $comp } }, $bug_num;
The value corresponding to each hash key is now a reference to an anonymous array containing the bug numbers as its elements.
Of course, this doesn’t eliminate duplicates. For that, you could use the uniq function (also called distinct) in List::MoreUtils.
Update: Added quote.
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
|
|---|