# just a bash function # file: src/bash/deploy/ubuntu/ubuntu-20.04.2-lts/check-install-perl-m +odules.func.sh do_check_install_perl_modules(){ cd $PRODUCT_DIR # this one is pre-defined in the beginning of your +bash script - the proj root dir # define the local::lib dir local_perl5dir=~/perl5 bash_opts_file=~/.bash_opts # bootstrap the cpan conf (echo yes;echo o conf prerequisites_policy follow;echo o conf commi +t)|cpan cat << EOF_CPAN_CONFIG | cpan o conf makepl_arg 'PREFIX=$local_perl5dir INSTALLMAN3DIR=$local_per +l5dir/man/man3' o conf mbuild_arg '--install_base $local_perl5dir' o conf mbuild_install_arg '--install_base $local_perl5dir' o conf mbuildpl_arg '--install-base $local_perl5dir' o conf commit EOF_CPAN_CONFIG perl -MCPAN -e 'install local::lib' curl -L http://cpanmin.us | perl - --self-upgrade -l $local_perl5di +r App::cpanminus \ && sudo chown -R $USER:$(id -gn) ~/.cpanm && sudo chown -R $USER +:$(id -gn) $local_perl5dir # stored in the src/bash/deploy/ubuntu/ubuntu-20.04.2-lts/check-ins +tall-perl-modules.lst file modules="$(cat ${BASH_SOURCE/.func.sh/.lst})" while read -r module ; do use_modules="${use_modules:-} use $module + ; "; done < <(echo "$modules"); perl -e "$use_modules" || { echo "deploying modules. This WILL take couple of min, but ONLY +ONCE !!!" curl -L cpanmin.us | perl - Mojolicious test "$(grep -c 'Mlocal::lib' $bash_opts_file)" -eq 0 && \ echo 'eval $(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)' >> $ +bash_opts_file while read -r module ; do cpanm_modules="${cpanm_modules:-} $mod +ule " ; done < <(echo "$modules") cpanm --local-lib=$local_perl5dir local::lib && eval $(perl -I $ +local_perl5dir/lib/perl5/ -Mlocal::lib) cmd="cpanm --local-lib=$local_perl5dir $modules" set -x $cmd set +e } } #eof file: src/bash/deploy/ubuntu/ubuntu-20.04.2-lts/check-install-per +l-modules.func.sh

In reply to Re: CPAN auto-configure by YordanGeorgiev
in thread CPAN auto-configure by initself

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.