How to Add Additional Perl Modules to Your Linux Installation


By: smflood

November 10, 2009 1:18 pm





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

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

0 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 5 (0 votes, average: 0.00 out of 5)
You need to be a registered member to rate this post.

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

Disclaimer: As with everything else in the SUSE Blog, 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.