in reply to Script Critique

suggestions that would make it a rock solid script
Yeah, un-comment line #2:
use strict;

You could also add some documentation on what it accomplishes, under what conditions and limitations, preferably as POD.

Have you created a test suite, using a CPAN module such as Test::More?