Solved

Regarding the PERL modules usage on UNIX/LINUX environment ?

Posted on 2011-09-29
8
394 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 4

Assisted Solution

by:Anacreo
Anacreo earned 100 total points
Comment Utility
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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:rajsolaris
Comment Utility
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
Comment Utility
Thanks wesly_chen & Anacreo for your valuable comments.
0
 
LVL 9

Expert Comment

by:parparov
Comment Utility
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
Comment Utility
Thanks all a lot.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

744 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now