Unless this code is run as root / superuser, it's very likely that CPAN won't be able to install the modules. If the code is running as root, why aren't the modules already installed?
It's much better to use the distribution packaging that CPAN modules come with. Take a look at Perl::Install for a distribution that has no actual modules, just scripts.
My criteria for good software:
- Does it work?
- Can someone else come in, make a change, and be reasonably certain no bugs were introduced?