in reply to how to improve my script

I suggest that you also test your code against http://perlcritic.com/, maybe with critic level set to "stern" for a start.

Also, I don't think it is a good idea to start your sub calls with &. Though it doesn't harm in your case, if you would call a sub having a prototype, you would bypass the conversion. Though I use & only if I really need to.

-- 
Ronald Fischer <ynnor@mm.st>