SUSE Conversations


How to Add Additional Perl Modules to Your Linux Installation

smflood

By: smflood

November 10, 2009 1:18 pm

Reads:1052

Comments:0

Rating:0

Depending on whether you’re using openSUSE, SUSE Linux Enterprise Desktop, SUSE Linux Enterprise Server or Open Enterprise Server and which version you’re using you may be lucky and find that you can easily add the required Perl module via YaST.

Here packages are named perl-<module> where double colons (::) are replaced by a minus (-) so for example the Net::SNMP module can be added by installing the perl-Net-SNMP package.

However the majority of Perl modules are not available through YaST so have to be added another way. Fortunately Perl on Linux provides a way of automating the manual process.

As root run

# perl -MCPAN -e 'shell'

If it’s the first time this has been done you need to answer some questions – you can either choose to autoconfigure these or run through manually and choose defaults. If you get prompted for a CPAN mirror URL use something suitable from http://search.cpan.org/mirror

Once done you can then install the additional modules – case is important!

For example, to install the Net::SMTP module do

cpan[#]> install Net::SMTP

at the end of which, if this is the first time using the shell, it will probably note that there’s a newer CPAN so then

cpan[#]> install CPAN

which may take a while!

Afterwards it will prompt you to reload CPAN so

cpan[#]> reload CPAN

To exit

cpan[#]> quit

VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)

Tags:
Categories: Enterprise Linux, SUSE Linux Enterprise Server, Technical Solutions

Disclaimer: As with everything else at SUSE Conversations, this content is definitely not supported by SUSE (so don't even think of calling Support if you try something and it blows up).  It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test, test, test before you do anything drastic with it.

Comment

RSS