#!/bin/bash
#$Id: centos7_CPAN_configuration.bash,v 1.10 2020/02/20 07:30:25 sofc Exp $
file='/root/.bashrc'
yum -y install wget
yum -y install perl-CPAN
yum -y install perl-CGI
yum -y install perl-Module-Build
echo "Add epel repository for CentOS"
if [[ $(uname -r) == *\.el8\.* ]]; then
    echo "Adding for CentOS8"
    yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
fi
if [[ $(uname -r) == *\.el7\.* ]]; then
    echo "Adding for CentOS7"
    yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
fi
if [[ $(uname -r) == *\.el6\.* ]]; then
    echo "Adding for CentOS6"
     yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
fi
echo "Remember to configure 'prerequisites_policy' to 'follow'"
perl -MCPAN -e 'shell'
sed -ie 's/export PERL/\#export PERL/g' $file
sed -ie 's/export PATH=\"\/root\/perl/\#export PATH=\"\/root\/perl/' $file
rm -rf /root/perl5
updatedb
