sherab there seems to be a HUGE mismatch between what you describe and what we understand. We are using the same words, but seem to mean different things by them. See I know what I mean. Why don't you? then reconsider your question. Then:
- Frame your question around some code that is as near your real problem as you can make it using just a few lines of code and a small amount of data.
- Show us the output you get.
- Show us the output you want.
Don't tell us what you think is happening because that hasn't seemed to help anyone.
Perl is the programming world's equivalent of English