• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 443
  • Last Modified:

Regarding the PERL modules usage on UNIX/LINUX environment ?

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.
3 Solutions
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.
Suhas .QA ManagerCommented:
Few important modules for system admins:

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.
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.
A proven path to a career in data science

At Springboard, we know how to get you a job in data science. With Springboard’s Data Science Career Track, you’ll master data science  with a curriculum built by industry experts. You’ll work on real projects, and get 1-on-1 mentorship from a data scientist.

  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"
rajsolarisAuthor Commented:
Sorry for being late was in the patching from last many days....

Hey parparov,

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

rajsolarisAuthor Commented:
Thanks wesly_chen & Anacreo for your valuable comments.
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.
rajsolarisAuthor Commented:
Thanks all a lot.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now