I notice this is your first post (under this username anyway), welcome to Perl Monks! If you have not done so please have a look at the PerlMonks FAQ, and How do I post a question effectively?. As kulls pointed out, a listing of your code along with the description of your problem (which you have already provided) would make it easier for us to help.