The problem is that you are updating your hash every time you see a new line. You need to update the hash conditionally on whether you've already seen the data you're interested in. Try changing your line:
acct{$x} = ($x,$line);To:
$acct{$x} = ($x,$line) unless exists $acct{$x}This way you only update your hash if you've never seen the account number before.
In reply to Re: Hash Question
by tj_thompson
in thread Hash Question
by mmittiga17
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |