Even though the answers already given might point you to the right thing, it is not clear to me from what you wrote what kind of problem you really have, and what you expect from the solution. If this is a problem not related to perl please consider posting it elsewhere, or do you think it might benefit the other monks too? If so, you need to explain more and give some examples to fiddle with IMHO.
Please have a look at
How do I post a question effectively? too if you did not already. If this sounds offensive to you, I regret. It is rather meant to be constructive criticism :)
Cheers,
jonix