CPAN stores build data in user's home folder, so if you run it as root (as required to install some modules) you can fill the root partition.
To reconfigure CPAN to use different build directory start cpan and the issue o conf init to re-run configuration.