There is one cpan option "inactivity timeout", preventing cpan from waiting forever, but it won't help you much here. Are you creating a script for a spesific installation job, or for the general case? If the first, then Expect might help.
Actually, Expect might be good in the general case too.
Unfortunately expect isn't an option since it doesn't run on Windows without cygwin (cygwin can't be installed). If there is a way to get expect on Windows, I would be so happy since that will simplify a bunch of problems.
The script is a general installation script for automation in Linux/Windows and sooner or later, Solaris, other misc *nixes and *shudder* Dos (if possible). This is just the first step of getting all the CPAN modules on test systems. Next is getting scripts and our modules on the test systems. Any other ideas would be appreciated.