?
Solved

Regarding the PERL modules usage on UNIX/LINUX environment ?

Posted on 2011-09-29
8
Medium Priority
?
430 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 38

Accepted Solution

by:
wesly_chen earned 1200 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 400 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
Is Your Team Achieving Their Full Potential?

74% of employees feel they are not achieving their full potential. With Linux Academy, not only will you strengthen your team's core competencies but also their knowledge of of the newest IT topics.

With new material every week, we'll make sure that you stay ahead of the game.

 
LVL 4

Assisted Solution

by:Anacreo
Anacreo earned 400 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans
Suggested Courses
Course of the Month14 days, 14 hours left to enroll

770 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