First, I would strongly advise against the direct 'perl way' installs, they will only make the mess bigger. You don't need these in Ubuntu. libwww-perl exists as a standard Ubuntu package.
Since this doesn't work. You should start by cleaning up your installation which seems to be broken. First, try cleaning-up your package installs like this:
sudo apt-get install -f
sudo apt-get update --fix-missing
and only when you don't get errors, move on to installing libwwww-perl, using:
sudo apt-get install libwww-perl
Also:
You seem to have a very unusual (non-standard) list of directories perl is searching libraries in. For example, there shouldn't be a /etc/perl in the places to look for libraries, and on Ubuntu you don't need anything starting with /usr/local.
To check whether the package is installed, you may check the output of:
dpkg-query -S libwww-perl
Check your env for bad forced perl paths:
env | grep PERL
If this gives any output, I would remove it from the environment before running perl:
Look at your startup files (~/.bashrc in particular end comment these non standard settings out)
Good luck!
If you want to install the Switch.pm Perl module into your system Perl config, there are two methods of installing it:
Install it through the Ubuntu repositories.
Install the .pm through CPAN.
At this time, both will provide the current version of this module(2.16).
Installing Switch.pm using the Ubuntu repositories:
From the command-line, the installation can be completed by running the following command from the terminal (Ctrl-Alt-t):
sudo apt-get install libswitch-perl
Within Synaptic, right-click on the libswitch-perl
package, select Mark for installation, then click on the Apply button.
Within the Ubuntu Software Center (USC), search for the phrase libswitch-perl
, highlight the package and select install:
Installing Switch.pm using CPAN:
If you would prefer to install this via cpan, follow these instructions:
Open a terminal(Ctrl-Alt-t).
Enter the command cpan
.
At the prompt cpan[1]>
, type install Switch
.
Once completed, Type exit
.
The Switch.pm Perl module will now be available for you to use in your scripts.
Best Answer
When writing your own applications, I recommend installing your own Perl. This was once a major pain, but no more. Nowadays, you can use perlbrew to build Perl for you.
On Ubuntu, I think you'll need the build-essential package first, if you don't already. After that, you can use the instructions on the perlbrew docs linked above to install it (or use
cpan App::perlbrew
).Once installed you can run:
Once you do that and make sure Perlbrew's bashrc is loaded into your bashrc, you should be ale to run:
and see that you're running 5.12.
The official
perlbrew
website is https://perlbrew.pl and it suggests installing by runningThen you will still need to
of course. Finally if you have multiple cores (and who doesn't these days) you can run
where
N
is the number of jobs requested, often the number of cores you have plus one. I use-j 5
on my quad-core and-j 3
on my dual-core netbook.