If you add the line:
++$fragment{$frag}{$val};
following ++$fragment{$frag}{items}; in the innermost loop in the main block you record the quantities at each price that were used to achieve each person's package.
Oh, small nit (that may be covered by "I left it the way it is ...")- you didn't allocate anything to E because it wasn't included in %fragment.
In reply to Re^2: Average Price Algorithm
by GrandFather
in thread Average Price Algorithm
by camelcom
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |