in reply to This does not look like start end
I don't think we have enough information to help you here. Is it possible for you to post the script?
It is usually helpful to distill your script down to the bare minimum amount of code which still exhibits your bug.
Also, if you add use strict and use warnings to the top of your script you might get some clues from Perl itself.