SlideShare une entreprise Scribd logo
1  sur  26
Télécharger pour lire hors ligne
Managing Perl Installations:
    A SysAdmin’s View 1,2,3

                                          Baden Hughes
Department of Computer Science and Software Engineering
                             The University of Melbourne
                           badenh@csse.unimelb.edu.au




                                                           1
What the title really means …

 Managing Perl Installations:
 A SysAdmin’s View 1
   Useful things a SysAdmin should know about Perl
 Managing Perl Installations:
 A SysAdmin’s View 2
   What you can do if you actually RTFM
 Managing Perl Installations:
 A SysAdmin’s View 3
   5327 other things you can do with CPAN

                                                     2
Overview

 Perl, Modules, CPAN
 Problems and Objectives
 The Sharp and Pointy Bits
   Module Management
   Bundles
   Working within User-space
 Conclusion

                               3
Perl
 http://www.perl.org
 Perl is a dynamic procedural programming
 language
 Designed by Larry Wall, maintained as open
 source project
 First released in 1987
 Perl borrows features from C, shell scripting
 (sh), awk, sed, Lisp, and (to a lesser extent)
 many other programming languages.
 Ubiquitous
                                                  4
Perl Modules

 A Perl module is a discrete component of
 software for the Perl programming language.
 Modules distinguished by a unique namespace,
 e.g. quot;CGIquot; or quot;Net::FTPquot; or quot;XML::Parserquot;.
 Convention of one module per file with a *.pm
 extension.
 Collection of one or more modules, with
 accompanying documentation (yes, really) and
 build scripts, compose a package.

                                                 5
CPAN

 Comprehensive Perl Archive Network
   http://cpan.org
   A large collection of Perl software (modules,
   packages and scripts) and associated
   documentation
 A Perl module (CPAN.pm)
    perl –MCPAN –e shell
   Used to download and install Perl software from
   the CPAN archive
                                                   6
Scoping the Problem
 On multi-user systems, particularly where there
 are Perl-oriented developers of some flavour,
 being responsible for Perl can be quite onerous
 The defaults for maintaining Perl on a shared
 system are typically
   Every user compiles and runs their own version of Perl
   Constant trickle of requests for Perl and/or module
   upgrades and/or additions
 Naturally neither of these are considered
 desirable by typical sysadmins since they have
 both system resource and human effort
 constraints
                                                            7
Objectives

 Get smarter: Perl itself can make managing a
 Perl installation on a shared system much easier
 Objectives
   Demonstrate ways to manage Perl installations based
   on commonly occurring tasks
   Show ‘core Perl’ methods that work everywhere, not
   distribution specific methods which only work on one
   platform
 Get users to help you, rather than the other way
 around
                                                          8
Modules

 Which modules are on my system ?
 Installing modules
 Removing modules




                                    9
Q: Which modules are on my system ?
A: perldoc perllocal

    perldoc perllocal will identify a list of
    modules, their version, location etc.
Tue Oct    4 17:00:07 2005: quot;Modulequot; Geo::GNIS
*   quot;installed into: /usr/lib/perl5/site_perl/5.8.5quot;
*   quot;LINKTYPE: dynamicquot;
*   quot;VERSION: 0.01quot;
*   quot;EXE_FILES: quot;




                                                       10
Q: Which modules are on my system ?
A: ExtUtils::Installed
 Use the ExtUtils::Installed module
  #!/usr/local/bin/perl
  use ExtUtils::Installed;
  my $instmod = ExtUtils::Installed->new();
  foreach my $module ($instmod->modules())
  {
     my $version = $instmod->version($module) || quot;???quot;;
     print quot;$module -- $versionnquot;;
   }

       produces a list of modules and their version(s)
 ExtUtils::Installed is in the standard Perl installation, and uses the
 installation generated files for modules to determine status


                                                                          11
Q: Which modules are on my system ?
A: pmtools
 The pmtools suite to help navigate and
 manage Perl module installations
 Obtain them at
 http://language.perl.com/misc/pmtools-
 1.00.tar.gz.
 pmtools -- a suite of small programs to help
 manage modules
   pmpath - show the module' full path
                               s
   pmvers - get a module version number
   pmdesc - get a module description
   pmall - get all installed modules pmdesc descriptions
   pminst - find what' installed
                        s
                                                           12
Installing Modules

 With CPAN.pm, installing a new module is
 trivial:
 perl -MCPAN -e 'install Esoteric::Module’
 Finding which modules exist and their
 versions can also be done directly via
 CPAN
  cpan > i $KEYWORD


                                             13
Removing Modules (1)
 By using the ExtUtils::Installed and ExtUtils::Packlist
 modules that come with Perl
 #!/usr/local/bin/perl -w
 use ExtUtils::Packlist;
 use ExtUtils::Installed;
 $ARGV[0] or die quot;Usage: $0 Module::Namenquot;;
 my $mod = $ARGV[0];
 my $inst = ExtUtils::Installed->new();
 foreach my $item (sort($inst->files($mod)))
 {
  print quot;removing $itemnquot;;
  unlink $item;
 }
 my $packfile = $inst->packlist($mod)->packlist_file();
 print quot;removing $packfilenquot;;
 unlink $packfile;
                                                           14
Removing Modules (2)

 PPM can uninstall modules
 shell>ppm remove $MODULE-NAME
 CPAN.pm doesn’t have a ‘remove’ option




                                          15
Bundles

 What is a Bundle ?
 Which Bundles exist ?
 Making Bundles (single point of Perl
 administration for multiple systems)




                                        16
Q: What is a Bundle ?
 A bundle is quot;A group of related modules on CPAN (or
 some repository“
   A bundle can be any collection of modules, related or not.
 Bundles are used by CPAN.pm to install a group of
 modules quickly and easily.
 A bundle is essentially a module in the Bundle::
 namespace that has all the look and feel of a module but
 really isn'since it contains no code instead having a
           t
 manifest of modules to be installed.
 There are a number of existing module bundles that you
 can view as examples to help in building your own.


                                                                17
Q: Which Bundles already exist ?
   You can get a list of bundle distributions on search.cpan.org and CPAN.pm also lists
   all currently available bundles when you type ' at the prompt.
                                                   b'
cpan> b Bundle
   Bundle::ABH (A/AB/ABH/Bundle-ABH-1.04.tar.gz) Bundle
   Bundle::AO::Base (I/IX/IX/AO-0.32.tar.gz) Bundle
   Bundle::AO::Standard (I/IX/IX/AO-0.32.tar.gz) Bundle
   Bundle::Apache (D/DO/DOUGM/mod_perl-1.25.tar.gz) Bundle
   Bundle::Apache::ASP (C/CH/CHAMAS/Apache-ASP-2.09.tar.gz) Bundle
   If you give ' a module argument it will list extended information about the bundle
                b'
   itself.
cpan> b Bundle::DBI
Bundle id = Bundle::DBI
CPAN_USERID TIMB (Tim Bunce <Tim.Bunce@pobox.com>)
CPAN_VERSION 1.03
CPAN_FILE T/TI/TIMB/DBI-1.15.tar.gz
MANPAGE Bundle::DBI - A bundle to install DBI and required
   modules.
CONTAINS Storable Net::Daemon RPC::PlServer Getopt::Long DBI
INST_FILE /usr/local/lib/perl5/site_perl/5.005/sun4-
   solaris/Bundle/DBI.pm
INST_VERSION 1.03
                                                                                     18
Q: How can I make a Bundle ?
 Use the autobundle feature of CPAN.pm
 autobundle will, if no arguments are given, inventory
 all modules installed on the system and make a
 systemwide bundle.
 If you only want a few modules in the bundle you can
 simply give it a list of modules and it will do the rest.
 user@host /home/user/> perl -MCPAN -eshell cpan>
   autobundle CGI Crypt::Rot13 Date::Christmas
   Date::Manip
 By default bundles are named
 quot;Snapshot_YYYY_MM_DD_HH_MM_SS.pmquot;
 The resultant file may then be used with the CPAN.pm
 perl -MCPAN -e 'install Bundle::Snapshot_2006_04_09_10_36_24.pm'

                                                                    19
Bundles and System Administration

 Bundles are a very convenient way to
 maintain homogeneous installations
 across multiple systems, including across
 architectures
   Personal experience: create bundles for local
   and external modules; store bundles in a
   repository; checkout and install sequentially on
   development, test and production servers;
   single install experience, guaranteed
   homogeneity

                                                      20
User-space Perl


 Alternative locations for Modules
 Standard Perl plus Custom Modules
 User-specific CPAN




                                     21
Working with Perl in User Space

 Advanced users often want more control
 over their Perl installation on shared
 systems
 SysAdmins are reluctant to let users “do
 as they see fit” to system wide utilities
 CPAN requires elevated privileges
 Fortunately Perl offers several ways
 around this problem
                                             22
Installing Perl Modules in
Alternative Locations
 Any manually installed Perl module can be trivially
 installed in an alternative location, eg within ~/
 Set PREFIX and LIB when you run the Makefile.PL to
 install
    LIB is where the module files will go
    PREFIX is the stub directory for everything else
 user@host$ perl Makefile.PL 
 LIB=/home/user/lib 
 PREFIX=/home/user/lib
 The reason this works is because Perl has a standard
 way of installing modules, called MakeMaker


                                                        23
Standard Perl + Custom Modules

  Sometimes however, a user simply wants to
  install a few modules but use the standard
  system wide Perl installation
  In this case, setting the PERL5LIB environment
  variable can allow the inclusion of modules
  installed in non-standard locations

PERL5LIB=${PERL5LIB:+$PERL5LIB:}$HOME/lib/perl5



                                                   24
User-space CPAN

 CPAN can be configured differently for each
 user, and can install modules to custom
 locations on a system, eg ~/lib/perl5 and
 ~/share/man
 MyConfig.pm is a base module for precisely
 this purpose, and can be used in place of a
 standard CPAN.pm
 Allows users to directly use CPAN functionality,
 with no run time environment variables required

                                                    25
Conclusion

 Perl is ubiquitous
 On shared systems, Perl has native tools
 to reduce the administrative overhead
 Users can be empowered to maintain their
 own Perl infrastructure without significant
 effort
 RTFM’ing can actually be beneficial

                                           26

Contenu connexe

Tendances

&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />
tutorialsruby
 
R hive tutorial supplement 2 - Installing Hive
R hive tutorial supplement 2 - Installing HiveR hive tutorial supplement 2 - Installing Hive
R hive tutorial supplement 2 - Installing Hive
Aiden Seonghak Hong
 
R hive tutorial supplement 1 - Installing Hadoop
R hive tutorial supplement 1 - Installing HadoopR hive tutorial supplement 1 - Installing Hadoop
R hive tutorial supplement 1 - Installing Hadoop
Aiden Seonghak Hong
 
APACHE
APACHEAPACHE
APACHE
ARJUN
 

Tendances (19)

Puppet: From 0 to 100 in 30 minutes
Puppet: From 0 to 100 in 30 minutesPuppet: From 0 to 100 in 30 minutes
Puppet: From 0 to 100 in 30 minutes
 
The Gory Details of Debian packages
The Gory Details of Debian packagesThe Gory Details of Debian packages
The Gory Details of Debian packages
 
Hands on Docker - Launch your own LEMP or LAMP stack
Hands on Docker -  Launch your own LEMP or LAMP stackHands on Docker -  Launch your own LEMP or LAMP stack
Hands on Docker - Launch your own LEMP or LAMP stack
 
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />
 
Easy install
Easy installEasy install
Easy install
 
R hive tutorial supplement 2 - Installing Hive
R hive tutorial supplement 2 - Installing HiveR hive tutorial supplement 2 - Installing Hive
R hive tutorial supplement 2 - Installing Hive
 
Raj apache
Raj apacheRaj apache
Raj apache
 
]project-open[ Package Manager
]project-open[ Package Manager]project-open[ Package Manager
]project-open[ Package Manager
 
R hive tutorial supplement 1 - Installing Hadoop
R hive tutorial supplement 1 - Installing HadoopR hive tutorial supplement 1 - Installing Hadoop
R hive tutorial supplement 1 - Installing Hadoop
 
12 yum
12  yum12  yum
12 yum
 
How To Install Openbravo ERP 2.50 MP43 in Ubuntu
How To Install Openbravo ERP 2.50 MP43 in UbuntuHow To Install Openbravo ERP 2.50 MP43 in Ubuntu
How To Install Openbravo ERP 2.50 MP43 in Ubuntu
 
Prizm Installation Guide
Prizm Installation GuidePrizm Installation Guide
Prizm Installation Guide
 
How to build your own OpenStack distro using Puppet OpenStack
How to build your own OpenStack distro using Puppet OpenStackHow to build your own OpenStack distro using Puppet OpenStack
How to build your own OpenStack distro using Puppet OpenStack
 
Drupal in Libraries
Drupal in LibrariesDrupal in Libraries
Drupal in Libraries
 
are available here
are available hereare available here
are available here
 
Refcard en-a4
Refcard en-a4Refcard en-a4
Refcard en-a4
 
Yum (Linux)
Yum (Linux) Yum (Linux)
Yum (Linux)
 
Configure, Pack and Distribute: An RPM Creation Workshop
Configure, Pack and Distribute: An RPM Creation WorkshopConfigure, Pack and Distribute: An RPM Creation Workshop
Configure, Pack and Distribute: An RPM Creation Workshop
 
APACHE
APACHEAPACHE
APACHE
 

En vedette

Soc 02 Stross Justin
Soc 02 Stross JustinSoc 02 Stross Justin
Soc 02 Stross Justin
strossj1
 
Iad1 Q2 Hoorcollege 2 Labels En Visuele Structuur
Iad1 Q2 Hoorcollege 2   Labels En Visuele StructuurIad1 Q2 Hoorcollege 2   Labels En Visuele Structuur
Iad1 Q2 Hoorcollege 2 Labels En Visuele Structuur
Hans Kemp
 
0708 Introductie user experience design minor
0708 Introductie user experience design minor0708 Introductie user experience design minor
0708 Introductie user experience design minor
Hans Kemp
 
Eerste Bijeenkomst Afstudeerders
Eerste Bijeenkomst AfstudeerdersEerste Bijeenkomst Afstudeerders
Eerste Bijeenkomst Afstudeerders
Hans Kemp
 
Authentication means in electronic environments
Authentication means in electronic environmentsAuthentication means in electronic environments
Authentication means in electronic environments
StevenSegaert
 
Multicultural services at Salpaus Further Education
Multicultural services at Salpaus Further EducationMulticultural services at Salpaus Further Education
Multicultural services at Salpaus Further Education
George Bekiaridis
 
Ep 2012 week4-piaget_para-tarjetas
Ep 2012 week4-piaget_para-tarjetasEp 2012 week4-piaget_para-tarjetas
Ep 2012 week4-piaget_para-tarjetas
laurahe
 
Ep 2011 week3-development
Ep 2011 week3-developmentEp 2011 week3-development
Ep 2011 week3-development
laurahe
 
IBInnovation?coreytopf
IBInnovation?coreytopfIBInnovation?coreytopf
IBInnovation?coreytopf
Corey Topf
 
Zappos - General Mills - 8-5-09
Zappos - General Mills - 8-5-09Zappos - General Mills - 8-5-09
Zappos - General Mills - 8-5-09
zappos
 
Iad1 0809Q2 Hoorcollege 3 Beroepsproducten
Iad1 0809Q2 Hoorcollege 3   BeroepsproductenIad1 0809Q2 Hoorcollege 3   Beroepsproducten
Iad1 0809Q2 Hoorcollege 3 Beroepsproducten
Hans Kemp
 
Week 17 Sponges
Week 17 SpongesWeek 17 Sponges
Week 17 Sponges
Corey Topf
 

En vedette (20)

Soc 02 Stross Justin
Soc 02 Stross JustinSoc 02 Stross Justin
Soc 02 Stross Justin
 
Iad1 Q2 Hoorcollege 2 Labels En Visuele Structuur
Iad1 Q2 Hoorcollege 2   Labels En Visuele StructuurIad1 Q2 Hoorcollege 2   Labels En Visuele Structuur
Iad1 Q2 Hoorcollege 2 Labels En Visuele Structuur
 
Visuelereisdoororganisatielandv2 1225371301186079 8
Visuelereisdoororganisatielandv2 1225371301186079 8Visuelereisdoororganisatielandv2 1225371301186079 8
Visuelereisdoororganisatielandv2 1225371301186079 8
 
IAD1 0809 Q3 Hoorcollege 2 Labels En Visuele Structuur
IAD1 0809 Q3 Hoorcollege 2   Labels En Visuele StructuurIAD1 0809 Q3 Hoorcollege 2   Labels En Visuele Structuur
IAD1 0809 Q3 Hoorcollege 2 Labels En Visuele Structuur
 
0708 Introductie user experience design minor
0708 Introductie user experience design minor0708 Introductie user experience design minor
0708 Introductie user experience design minor
 
Eerste Bijeenkomst Afstudeerders
Eerste Bijeenkomst AfstudeerdersEerste Bijeenkomst Afstudeerders
Eerste Bijeenkomst Afstudeerders
 
Authentication means in electronic environments
Authentication means in electronic environmentsAuthentication means in electronic environments
Authentication means in electronic environments
 
Ejemploc de caso
Ejemploc de casoEjemploc de caso
Ejemploc de caso
 
User Created Content deel I
User Created Content deel IUser Created Content deel I
User Created Content deel I
 
Multicultural services at Salpaus Further Education
Multicultural services at Salpaus Further EducationMulticultural services at Salpaus Further Education
Multicultural services at Salpaus Further Education
 
Kick Off
Kick OffKick Off
Kick Off
 
A1 olympics
A1 olympicsA1 olympics
A1 olympics
 
Unit 2
Unit 2Unit 2
Unit 2
 
Keynote deeldag nijmegen_deelstad_2015
Keynote deeldag nijmegen_deelstad_2015Keynote deeldag nijmegen_deelstad_2015
Keynote deeldag nijmegen_deelstad_2015
 
Ep 2012 week4-piaget_para-tarjetas
Ep 2012 week4-piaget_para-tarjetasEp 2012 week4-piaget_para-tarjetas
Ep 2012 week4-piaget_para-tarjetas
 
Ep 2011 week3-development
Ep 2011 week3-developmentEp 2011 week3-development
Ep 2011 week3-development
 
IBInnovation?coreytopf
IBInnovation?coreytopfIBInnovation?coreytopf
IBInnovation?coreytopf
 
Zappos - General Mills - 8-5-09
Zappos - General Mills - 8-5-09Zappos - General Mills - 8-5-09
Zappos - General Mills - 8-5-09
 
Iad1 0809Q2 Hoorcollege 3 Beroepsproducten
Iad1 0809Q2 Hoorcollege 3   BeroepsproductenIad1 0809Q2 Hoorcollege 3   Beroepsproducten
Iad1 0809Q2 Hoorcollege 3 Beroepsproducten
 
Week 17 Sponges
Week 17 SpongesWeek 17 Sponges
Week 17 Sponges
 

Similaire à Managing Perl Installations: A SysAdmin's View

Building a linux kernel
Building a linux kernelBuilding a linux kernel
Building a linux kernel
Raghu nath
 
Linux kernel driver tutorial vorlesung
Linux kernel driver tutorial vorlesungLinux kernel driver tutorial vorlesung
Linux kernel driver tutorial vorlesung
dns -
 
Automatic systems installations and change management wit FAI - Talk for Netw...
Automatic systems installations and change management wit FAI - Talk for Netw...Automatic systems installations and change management wit FAI - Talk for Netw...
Automatic systems installations and change management wit FAI - Talk for Netw...
Henning Sprang
 
Software management in linux
Software management in linuxSoftware management in linux
Software management in linux
nejadmand
 
Linux Kernel Programming
Linux Kernel ProgrammingLinux Kernel Programming
Linux Kernel Programming
Nalin Sharma
 

Similaire à Managing Perl Installations: A SysAdmin's View (20)

Perl 20tips
Perl 20tipsPerl 20tips
Perl 20tips
 
Linux Kernel Development
Linux Kernel DevelopmentLinux Kernel Development
Linux Kernel Development
 
Perl Modules
Perl ModulesPerl Modules
Perl Modules
 
Building a linux kernel
Building a linux kernelBuilding a linux kernel
Building a linux kernel
 
Linux kernel driver tutorial vorlesung
Linux kernel driver tutorial vorlesungLinux kernel driver tutorial vorlesung
Linux kernel driver tutorial vorlesung
 
How to make debian package from scratch (linux)
How to make debian package from scratch (linux)How to make debian package from scratch (linux)
How to make debian package from scratch (linux)
 
Automatic systems installations and change management wit FAI - Talk for Netw...
Automatic systems installations and change management wit FAI - Talk for Netw...Automatic systems installations and change management wit FAI - Talk for Netw...
Automatic systems installations and change management wit FAI - Talk for Netw...
 
Approaching package manager
Approaching package managerApproaching package manager
Approaching package manager
 
Lecture 5 Kernel Development
Lecture 5 Kernel DevelopmentLecture 5 Kernel Development
Lecture 5 Kernel Development
 
Puppet quick start guide
Puppet quick start guidePuppet quick start guide
Puppet quick start guide
 
Linux kernel modules
Linux kernel modulesLinux kernel modules
Linux kernel modules
 
Perlbrew
PerlbrewPerlbrew
Perlbrew
 
Apache
ApacheApache
Apache
 
Apache
ApacheApache
Apache
 
Software management in linux
Software management in linuxSoftware management in linux
Software management in linux
 
Docker dDessi november 2015
Docker dDessi november 2015Docker dDessi november 2015
Docker dDessi november 2015
 
Linux Kernel Programming
Linux Kernel ProgrammingLinux Kernel Programming
Linux Kernel Programming
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014
 
Plenv and carton
Plenv and cartonPlenv and carton
Plenv and carton
 
Node js Global Packages
Node js Global PackagesNode js Global Packages
Node js Global Packages
 

Plus de Baden Hughes

Plus de Baden Hughes (14)

Closing the Gap: Data Models for Documentary Linguistics
Closing the Gap: Data Models for Documentary LinguisticsClosing the Gap: Data Models for Documentary Linguistics
Closing the Gap: Data Models for Documentary Linguistics
 
If We're Not There Yet, How Far Do We Have To Go ? Web Metadata at The Univer...
If We're Not There Yet, How Far Do We Have To Go ? Web Metadata at The Univer...If We're Not There Yet, How Far Do We Have To Go ? Web Metadata at The Univer...
If We're Not There Yet, How Far Do We Have To Go ? Web Metadata at The Univer...
 
Building Computational Grids with Apple’s Xgrid Middleware
Building Computational Grids with Apple’s Xgrid MiddlewareBuilding Computational Grids with Apple’s Xgrid Middleware
Building Computational Grids with Apple’s Xgrid Middleware
 
Functional Requirements for an Interlinear Text Editor
Functional Requirements for an Interlinear Text EditorFunctional Requirements for an Interlinear Text Editor
Functional Requirements for an Interlinear Text Editor
 
Management of Metadata in Linguistic Fieldwork: Experience from the ACLA Pro...
Management of Metadata in Linguistic Fieldwork: Experience from the ACLA Pro...Management of Metadata in Linguistic Fieldwork: Experience from the ACLA Pro...
Management of Metadata in Linguistic Fieldwork: Experience from the ACLA Pro...
 
Disambiguating Advanced Computing for Humanities Researchers
Disambiguating Advanced Computing for Humanities ResearchersDisambiguating Advanced Computing for Humanities Researchers
Disambiguating Advanced Computing for Humanities Researchers
 
Metadata Quality Evaluation: Experience from the Open Language Archives Commu...
Metadata Quality Evaluation: Experience from the Open Language Archives Commu...Metadata Quality Evaluation: Experience from the Open Language Archives Commu...
Metadata Quality Evaluation: Experience from the Open Language Archives Commu...
 
Encoding and Presenting Interlinear Text Using XML Technologies
Encoding and Presenting Interlinear Text Using XML TechnologiesEncoding and Presenting Interlinear Text Using XML Technologies
Encoding and Presenting Interlinear Text Using XML Technologies
 
Refactoring Metadata:
Refactoring Metadata:Refactoring Metadata:
Refactoring Metadata:
 
Towards a Web Search Service for Minority Language Communities
Towards a Web Search Service for Minority Language CommunitiesTowards a Web Search Service for Minority Language Communities
Towards a Web Search Service for Minority Language Communities
 
Change Management and Versioning in Ontologies
Change Management and Versioning in OntologiesChange Management and Versioning in Ontologies
Change Management and Versioning in Ontologies
 
Object Reuse and Exchange (ORE) : Experience in the Open Language Archives Co...
Object Reuse and Exchange (ORE) : Experience in the Open Language Archives Co...Object Reuse and Exchange (ORE) : Experience in the Open Language Archives Co...
Object Reuse and Exchange (ORE) : Experience in the Open Language Archives Co...
 
The Effects of Cross-Pollination : How non-library mass market services are c...
The Effects of Cross-Pollination : How non-library mass market services are c...The Effects of Cross-Pollination : How non-library mass market services are c...
The Effects of Cross-Pollination : How non-library mass market services are c...
 
Why Digitization Increases the Value of Print Collections
Why Digitization Increases the Value of Print CollectionsWhy Digitization Increases the Value of Print Collections
Why Digitization Increases the Value of Print Collections
 

Dernier

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Dernier (20)

Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 

Managing Perl Installations: A SysAdmin's View

  • 1. Managing Perl Installations: A SysAdmin’s View 1,2,3 Baden Hughes Department of Computer Science and Software Engineering The University of Melbourne badenh@csse.unimelb.edu.au 1
  • 2. What the title really means … Managing Perl Installations: A SysAdmin’s View 1 Useful things a SysAdmin should know about Perl Managing Perl Installations: A SysAdmin’s View 2 What you can do if you actually RTFM Managing Perl Installations: A SysAdmin’s View 3 5327 other things you can do with CPAN 2
  • 3. Overview Perl, Modules, CPAN Problems and Objectives The Sharp and Pointy Bits Module Management Bundles Working within User-space Conclusion 3
  • 4. Perl http://www.perl.org Perl is a dynamic procedural programming language Designed by Larry Wall, maintained as open source project First released in 1987 Perl borrows features from C, shell scripting (sh), awk, sed, Lisp, and (to a lesser extent) many other programming languages. Ubiquitous 4
  • 5. Perl Modules A Perl module is a discrete component of software for the Perl programming language. Modules distinguished by a unique namespace, e.g. quot;CGIquot; or quot;Net::FTPquot; or quot;XML::Parserquot;. Convention of one module per file with a *.pm extension. Collection of one or more modules, with accompanying documentation (yes, really) and build scripts, compose a package. 5
  • 6. CPAN Comprehensive Perl Archive Network http://cpan.org A large collection of Perl software (modules, packages and scripts) and associated documentation A Perl module (CPAN.pm) perl –MCPAN –e shell Used to download and install Perl software from the CPAN archive 6
  • 7. Scoping the Problem On multi-user systems, particularly where there are Perl-oriented developers of some flavour, being responsible for Perl can be quite onerous The defaults for maintaining Perl on a shared system are typically Every user compiles and runs their own version of Perl Constant trickle of requests for Perl and/or module upgrades and/or additions Naturally neither of these are considered desirable by typical sysadmins since they have both system resource and human effort constraints 7
  • 8. Objectives Get smarter: Perl itself can make managing a Perl installation on a shared system much easier Objectives Demonstrate ways to manage Perl installations based on commonly occurring tasks Show ‘core Perl’ methods that work everywhere, not distribution specific methods which only work on one platform Get users to help you, rather than the other way around 8
  • 9. Modules Which modules are on my system ? Installing modules Removing modules 9
  • 10. Q: Which modules are on my system ? A: perldoc perllocal perldoc perllocal will identify a list of modules, their version, location etc. Tue Oct 4 17:00:07 2005: quot;Modulequot; Geo::GNIS * quot;installed into: /usr/lib/perl5/site_perl/5.8.5quot; * quot;LINKTYPE: dynamicquot; * quot;VERSION: 0.01quot; * quot;EXE_FILES: quot; 10
  • 11. Q: Which modules are on my system ? A: ExtUtils::Installed Use the ExtUtils::Installed module #!/usr/local/bin/perl use ExtUtils::Installed; my $instmod = ExtUtils::Installed->new(); foreach my $module ($instmod->modules()) { my $version = $instmod->version($module) || quot;???quot;; print quot;$module -- $versionnquot;; } produces a list of modules and their version(s) ExtUtils::Installed is in the standard Perl installation, and uses the installation generated files for modules to determine status 11
  • 12. Q: Which modules are on my system ? A: pmtools The pmtools suite to help navigate and manage Perl module installations Obtain them at http://language.perl.com/misc/pmtools- 1.00.tar.gz. pmtools -- a suite of small programs to help manage modules pmpath - show the module' full path s pmvers - get a module version number pmdesc - get a module description pmall - get all installed modules pmdesc descriptions pminst - find what' installed s 12
  • 13. Installing Modules With CPAN.pm, installing a new module is trivial: perl -MCPAN -e 'install Esoteric::Module’ Finding which modules exist and their versions can also be done directly via CPAN cpan > i $KEYWORD 13
  • 14. Removing Modules (1) By using the ExtUtils::Installed and ExtUtils::Packlist modules that come with Perl #!/usr/local/bin/perl -w use ExtUtils::Packlist; use ExtUtils::Installed; $ARGV[0] or die quot;Usage: $0 Module::Namenquot;; my $mod = $ARGV[0]; my $inst = ExtUtils::Installed->new(); foreach my $item (sort($inst->files($mod))) { print quot;removing $itemnquot;; unlink $item; } my $packfile = $inst->packlist($mod)->packlist_file(); print quot;removing $packfilenquot;; unlink $packfile; 14
  • 15. Removing Modules (2) PPM can uninstall modules shell>ppm remove $MODULE-NAME CPAN.pm doesn’t have a ‘remove’ option 15
  • 16. Bundles What is a Bundle ? Which Bundles exist ? Making Bundles (single point of Perl administration for multiple systems) 16
  • 17. Q: What is a Bundle ? A bundle is quot;A group of related modules on CPAN (or some repository“ A bundle can be any collection of modules, related or not. Bundles are used by CPAN.pm to install a group of modules quickly and easily. A bundle is essentially a module in the Bundle:: namespace that has all the look and feel of a module but really isn'since it contains no code instead having a t manifest of modules to be installed. There are a number of existing module bundles that you can view as examples to help in building your own. 17
  • 18. Q: Which Bundles already exist ? You can get a list of bundle distributions on search.cpan.org and CPAN.pm also lists all currently available bundles when you type ' at the prompt. b' cpan> b Bundle Bundle::ABH (A/AB/ABH/Bundle-ABH-1.04.tar.gz) Bundle Bundle::AO::Base (I/IX/IX/AO-0.32.tar.gz) Bundle Bundle::AO::Standard (I/IX/IX/AO-0.32.tar.gz) Bundle Bundle::Apache (D/DO/DOUGM/mod_perl-1.25.tar.gz) Bundle Bundle::Apache::ASP (C/CH/CHAMAS/Apache-ASP-2.09.tar.gz) Bundle If you give ' a module argument it will list extended information about the bundle b' itself. cpan> b Bundle::DBI Bundle id = Bundle::DBI CPAN_USERID TIMB (Tim Bunce <Tim.Bunce@pobox.com>) CPAN_VERSION 1.03 CPAN_FILE T/TI/TIMB/DBI-1.15.tar.gz MANPAGE Bundle::DBI - A bundle to install DBI and required modules. CONTAINS Storable Net::Daemon RPC::PlServer Getopt::Long DBI INST_FILE /usr/local/lib/perl5/site_perl/5.005/sun4- solaris/Bundle/DBI.pm INST_VERSION 1.03 18
  • 19. Q: How can I make a Bundle ? Use the autobundle feature of CPAN.pm autobundle will, if no arguments are given, inventory all modules installed on the system and make a systemwide bundle. If you only want a few modules in the bundle you can simply give it a list of modules and it will do the rest. user@host /home/user/> perl -MCPAN -eshell cpan> autobundle CGI Crypt::Rot13 Date::Christmas Date::Manip By default bundles are named quot;Snapshot_YYYY_MM_DD_HH_MM_SS.pmquot; The resultant file may then be used with the CPAN.pm perl -MCPAN -e 'install Bundle::Snapshot_2006_04_09_10_36_24.pm' 19
  • 20. Bundles and System Administration Bundles are a very convenient way to maintain homogeneous installations across multiple systems, including across architectures Personal experience: create bundles for local and external modules; store bundles in a repository; checkout and install sequentially on development, test and production servers; single install experience, guaranteed homogeneity 20
  • 21. User-space Perl Alternative locations for Modules Standard Perl plus Custom Modules User-specific CPAN 21
  • 22. Working with Perl in User Space Advanced users often want more control over their Perl installation on shared systems SysAdmins are reluctant to let users “do as they see fit” to system wide utilities CPAN requires elevated privileges Fortunately Perl offers several ways around this problem 22
  • 23. Installing Perl Modules in Alternative Locations Any manually installed Perl module can be trivially installed in an alternative location, eg within ~/ Set PREFIX and LIB when you run the Makefile.PL to install LIB is where the module files will go PREFIX is the stub directory for everything else user@host$ perl Makefile.PL LIB=/home/user/lib PREFIX=/home/user/lib The reason this works is because Perl has a standard way of installing modules, called MakeMaker 23
  • 24. Standard Perl + Custom Modules Sometimes however, a user simply wants to install a few modules but use the standard system wide Perl installation In this case, setting the PERL5LIB environment variable can allow the inclusion of modules installed in non-standard locations PERL5LIB=${PERL5LIB:+$PERL5LIB:}$HOME/lib/perl5 24
  • 25. User-space CPAN CPAN can be configured differently for each user, and can install modules to custom locations on a system, eg ~/lib/perl5 and ~/share/man MyConfig.pm is a base module for precisely this purpose, and can be used in place of a standard CPAN.pm Allows users to directly use CPAN functionality, with no run time environment variables required 25
  • 26. Conclusion Perl is ubiquitous On shared systems, Perl has native tools to reduce the administrative overhead Users can be empowered to maintain their own Perl infrastructure without significant effort RTFM’ing can actually be beneficial 26