"be consistent" | |
PerlMonks |
Re: Help in manipulating values from two arraysby Anno (Deacon) |
on Mar 24, 2007 at 09:02 UTC ( [id://606398]=note: print w/replies, xml ) | Need Help?? |
Your output sample shows employee 3379 twice. I'll assume that is an error.
You are assuming you already have a list @inlst of employees, though your code doesn't show where it comes from. The program should probably build the list as it goes along. Here is one way to do it (__DATA__ section not shown): Anno Update: I agree with GrandFather that an appropriate parser is a better solution. Update: Noticed an optimisation. The pesky $prod{ $emp} ||= []; can go from the while loop and everything rely on autovivification as it should:
In Section
Seekers of Perl Wisdom
|
|