Post the actual script which results in these errors, the perl script you have posted has fewer lines than the one you ran which generated the error. How do I post a question effectively?, post code which you have run that results in the error you post