calling perl commands in shell

i have four commands

  1. perl -MCPAN -e shell
  2. o conf prerequisites_policy follow
  3. o conf commit
  4. exit

I am attempting to streamline a bunch of yum commands and cpan installations and want to remove the confirmation portion of the cpan these four commands will do just that. my question. If it is possible, how do i place these into the shell script to run these commands after doing the yum install but before doing the cpan install

NOTE: I must use cpan instead of searching for these modules in rpms as the program they are used by has an issue with using rpms over the cpan modules.

ex.

#!/bin/sh
# File: rpm_prereq.sh

yum install -y glibc-devel
yum install -y httpd perl mod_perl mod_ssl
yum install -y mysql mysql-server
yum install -y nscd rsyslog
yum install -y gcc make
yum install -y rrdtool htmldoc

service mysqld start

(place those commands here)
cpan Apache::ASP App::Info Cache::Cache Crypt::PasswdMD5
cpan SBECK/Date-Manip-5.56.tar.gz
cpan DBD::mysql DBI
cpan JSON Linux::Inotify2 List::MoreUtils
cpan Locale::Maketext::Lexicon Locale::Maketext::Simple

any assistance will be grately appreciated.

In ~/.cpan/CPAN/ there is a file called MyConfig.pm. This is where your configuration is written when you type "o conf commit" at the cpan shell. You already have figured out the directive to set, "prerequisites_policy" and that should be set to "follow", which will automatically try and pull in any dependencies for you.

Once you have set that ( either in the cpan shell, or by editing ~/.cpan/CPAN/MyConfig.pm directly), why not just do this:

cpan install YAML::XS >> cpan.log 2>&1
cpan install JSON::XS >> cpan.log 2>&1

That should silence any messages to the screen and keep a record for you ( "cpan.log" ), in case anything blew up.

I threw that in the config.pm file and also attempted all the cpan installs with it.

I noticed almost everything that originally would ask if i wanted to prepend pre-req. modules is no longer asking me, HOWEVER, it appears those modules fail (issue about the make install returns bad status.) shouldnt the follow policy automatically prepend for me?