I agree that it would make more sense to have the perl handle this, but I am not quit sure how I would do it. Let me do some diggin and see what I can come up with, also if you find a good solution in the meantime please share with me as I would be very curious as to what you came up with.