Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: scripting a perl install on *nix, including making the workstation usable

by Aldebaran (Deacon)
on Feb 13, 2020 at 21:49 UTC ( #11112940=note: print w/replies, xml ) Need Help??


in reply to Re: scripting a perl install on *nix, including making the workstation usable
in thread scripting a perl install on *nix, including making the workstation usable

A two decades old piece of paper hanging in a dark corner at my home office wall qualifies me as Diplom-Informatiker (so I'm a graduate computer scientist). Theoretically, I studied computer networking, but practically it was all about software. I got that piece of paper for developing a project management software, and I've been working for that two decades as a professional software developer. BUT: I also do system and network administration, not because I was formally qualified, but because it can be fun and in a team of software developers, I'm often the one knowing most about networks. See Re^3: Working Solo and in a Team.

Thanks for your general yet personal comments that did hit the thrust of my questions, Alvin. I found the linked reading also worthwhile. Since I don't get a chance to thank you for your prolific writings on the net on perl syntax as I consult them, let me tell you how worthwhile they are to me as a person who sits outside of such organizations. I understand your injunction in Re: Perl Passion website. Since I refer to you and it in fixing Log::Log4perl was Re: Petty janitor post vandalism, I might direct your attention there as well.

I would like to continue with some more code and output from the install that I initially described as "flawless." (ahem) It turns out that supplying the value 'undef' as the second parameter in a require statement leaves room for improvement.

I've been looking at the output of varying commands, for example this one:

$ cpan -D Moose CPAN: Storable loaded ok (v2.62) Reading '/home/gilligan/.cpan/Metadata' Database was generated on Wed, 12 Feb 2020 20:41:03 GMT Moose ---------------------------------------------------------------------- +--- (no description) E/ET/ETHER/Moose-2.2012.tar.gz /usr/lib/x86_64-linux-gnu/perl5/5.26/Moose.pm Installed: 2.2009 CPAN: 2.2012 Not up to date Karen Etheridge (ETHER) ether@cpan.org $

'Moose' was not on the list of modules to install, but I have it. Apparently, I didn't get the latest CPAN on this, and that would qualify as the "better thing" in this case.

Q5) Is there a way to ask for a version number such that it is the highest?

Q6) Do these warnings not make it seem like ExtUtils::MakeMaker needs an update?

$ cpan -l | grep cpanminus Use of uninitialized value $ExtUtils::MakeMaker::_version::CVSVERSION +in pattern match (m//) at (eval 213) line 7, <FILE> line 19. Use of uninitialized value $ExtUtils::MakeMaker::_version::CVSVERSION +in pattern match (m//) at (eval 214) line 7, <FILE> line 19. Use of uninitialized value $ExtUtils::MakeMaker::_version::CVSVERSION +in pattern match (m//) at (eval 215) line 7, <FILE> line 17. App::cpanminus 1.7044

I have been trying to determine what commands I have to add sudo to, where and how. Since I'm not going with a local::lib, I believe I need elevated privileges, which I typically prepend to a command. I'm going to list a bash script that shows an attempted perl module install, not because I want to force "the topic" to bash, but because I want to get away from this wrapper and do the whole thing in perl.

#!/bin/bash # # # keep a log named by time stamp export PATH=:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/ +bin set -u app=${0##*/} mkdir "mod_lists" pathto=mod_lists timename=$(date +"%m-%d-%Y_%H-%M-%S") out=$HOME/Documents/Documents/hogan/$pathto/$timename.log if [ 1 -eq 1 ] ; then echo "basename dollar sign zero is" $app echo "path is" $pathto echo "Munged time is" $timename echo "out fn is $out" echo "Time is $timename " > "$out" fi # end if [ 1 -eq 0 ] declare -ir SUCCESS=0 declare -ir E_FATAL=1 pwd | tee -a "$out" echo "installing useful packages:" | tee -a "$out" sudo perl -MCPAN -e 'install Bundle::CPAN' | tee -a "$out" ./1.mod.pl | tee -a "$out" echo "end of output" | tee -a "$out" gedit $out & read -n 1 echo "duration=$SECONDS" | tee -a "$out" date | tee -a "$out" exit $SUCCESS

The main purpose of the script is to create a file that will log what happens on the terminal through the use of the | tee -a "$out". It creates a file based on a munged form of the time. Also, it houses the commands I'm testing:

sudo perl -MCPAN -e 'install Bundle::CPAN' | tee -a "$out"

This did not result in this module being installed. I don't know if the problem is with the command or whether my install doesn't have the proper headers yet. Usually, I have to "feel my way through it," which seems more to imitate a blind guy tapping things with his cane till he figures out their shape.

Q7) Can I not recast this script using Log::Log4perl, this module that has come to my attention recently as a sticky wicket?

Q8) Does one imitate Tatsuhiko Miyagawa's command to acquire App::cpanminus?

curl -L https://cpanmin.us | perl - --sudo App::cpanminus

Thanks all for comments,

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11112940]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (9)
As of 2020-11-30 12:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?