As an aside, I find it very scary that you are providing "professional" Perl coding (or I am assuming you are with a name like perlservices) and your code is not using strict or warnings, and silently ignoring io and system call errors.
-pete
"Worry is like a rocking chair. It gives you something to do, but it doesn't get you anywhere."