I have small problem cause everytime i issuecpan YAMLor try to install any perl module it install's it inito /root/perl5 and with this any other user cannot use modules that I've installed as a root.Even if I do rm -frv /root/perl5 /root/.cpanand rerun cpan YAML it still installs into root home dir. How can i change this ?
Debian Wheezy and perl modules installed into /root not system
software installation;perl
There exists a config file which defines the default settings. You can find the file under the cpan's install path under CPAN/Config.pm. The path is usally  /usr/lib/perl5/<version>/.My suggestion would be to adjust the values of makepl_arg and mbuildpl_arg in the global config file since perl modules are either build and installed via MakeMaker or Build. If you put this:'makepl_arg' => q[INSTALLDIRS=perl INSTALLBIN=/opt/mycpanmodules/bin/ INSTALLARCHLIB=/opt/mycpanmodules/perl5/ INSTALLPRIVLIB=/opt/mycpanmodules/perl5/ INSTALLSCRIPT=/opt/mycpanmodules/perl5/ INSTALLMAN1DIR=/opt/mycpanmodules/man/ INSTALLMAN3DIR=/opt/mycpanmodules/man/],'mbuildpl_arg' => q[--install_path lib=/opt/mycpanmodules/perl5/ --install_path arch=/opt/mycpanmodules/perl5/ --install_path script=/opt/mycpanmodules/bin/ --install_path bindoc=/opt/mycpanmodules/man/ --install_path libdoc=/opt/mycpanmodules/man/],in your Config.pm all modules that are installed via cpan goes to /opt/mycpanmodules.Eventually you have to set the environment variable PERL5LIB=/opt/mycpanmodules/perl5so that your local perl knows where to search for the additionally installed modules.