Solved

Regarding the PERL modules usage on UNIX/LINUX environment ?

Posted on 2011-09-29
8
411 Views
Last Modified: 2012-05-12
Hi Experts,

Please enlighten me regarding the PERL modules usage on UNIX/LINUX env.
I have few doubts regarding the same.

1. before using any module's functionality - that module should be on each & every system where it is intented to be used.
2. If the module needs to be installed on the production env. How safe it is ? Does that need some security permissions ?
3. Which are the useful/importanr PERL modules for the UNIX Admins.

Thanks a lot in advance.
0
Comment
Question by:rajsolaris
8 Comments
 
LVL 38

Accepted Solution

by:
wesly_chen earned 300 total points
ID: 36818837
A1. Perl modules usually are installed under perl lib directory, such as /usr/lib/perl/ (Linux)

A2. You don't want some one mess up your installed dir, so it is better to installed as root (own by root, and only root have write permission)

A3. It depends. Perl come with some basic modules like IO, WARNING...
     Some application like php, apache need more perl modules to function.
     Install those modules when it needs.

For better practice, you might want to have one machine be the central management machine for each OS.
Say one  for redhat 5, another for Solaris, the other redhat 6....
Then install your version of perl on, say, /usr/local/perl5, and all the modules under it.
Then NFS share out /usr/local/perl5 so other same type of OS can nfs mount it on their /usr/local/.
So you only need to install on management machine and all other same OS machines have the identical installed version of all perl module.
0
 
LVL 9

Assisted Solution

by:Suhas .
Suhas . earned 100 total points
ID: 36892215
Few important modules for system admins:

DBI
File::Find
Net::Telnet
File::Spec - a core module to handle file and directory paths portably.
String-ShellQuote - quote strings for passing through the shell. Also see the list forms of system.
File::Path - a core module to create or remove directory trees (portably).
File::Copy - a core module to copy files.
IO-All - an all-in-one IO package with a lot of syntactic sugar. Non-core.
0
 
LVL 9

Expert Comment

by:parparov
ID: 36894848
You may also want to have an internal mirror of CPAN for your company, so that the modules' installation is always quick and easy. Mirroring CPAN is very easy.
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 4

Assisted Solution

by:Anacreo
Anacreo earned 100 total points
ID: 36894874
Wesley,
  How does your strategy handle modules that have compiled code in them?

  See: http://perldoc.perl.org/perlxs.html

  1. Before using any module's functionality - that module should be on each & every system where it is intended to be used.
    You could include the module with your code (if its purely Perl) and distribute it together.  Simply adjusting your @INC within your code would let you do this.
  This has a positive in that you don't have to worry about someone updating the module on you and breaking functionality, but it can also have the converse, you won't get updates to the module unless you do it yourself.

  2.  Installing modules on the production server can be done fairly safely, especially if using the CPAN interface, however there is risk that the updated module could break a program that's been relying on it for years.  As with most things UNIX there is no reason why you can't install Perl Modules under your home directory and have Perl use them from there; which is what I highly recommend for non-system wide or application code.

Generally I recommend:
  Install the module at the OS level if it has common usage and brings benefit to the masses; or is required by system level components such as a monitoring environment, etc.
  Install application modules in some sort of application home directory (this way if you move the application the modules come with it, and OS updates don't break your application)
  Install user level modules in the users home directory (or let them do it if they know how)

By following this you'll get safety by only affecting the intended target, generally.

3.  Useful modules?

They're all useful, but the first time you run CPAN you'll get all of the essential ones installed for you besides the DBI  one...

Try runing "cpan" and if that fails try the glorious command I couldn't remember for 12 years straight: "perl -MCPAN -e shell"
0
 

Author Comment

by:rajsolaris
ID: 36924862
Sorry for being late was in the patching from last many days....

Hey parparov,

What is that Mirroing CPAN & How does it helps Sir ?

Thanks.
0
 

Author Comment

by:rajsolaris
ID: 36924998
Thanks wesly_chen & Anacreo for your valuable comments.
0
 
LVL 9

Expert Comment

by:parparov
ID: 36925173
Mirroring CPAN means having a local copy of CPAN in your company.
It helps by the fact you install anything much faster, and your mirror is more reliable, and you can also have your own modules together with official CPAN without need to publish them.
0
 

Author Closing Comment

by:rajsolaris
ID: 37033388
Thanks all a lot.
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
digital ocean web console access ? does it use port 22 4 26
Create an automated page index 9 53
Samba 4, Users Permission, 5 51
plsql job on oracle 18 41
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Fine Tune your automatic Updates for Ubuntu / Debian
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question