# Perl is downgraded



## joe5000 (Sep 11, 2011)

I had perl 5.14.1 installed. After installing apache with pkg_add perl is downgraded to 5.10 without notice. Same happened earlier when I installed Midnight Commander from ports. Are both versions of perl on my machine or is the upper version overwritten by lower version?

How can I prevent perl from downgrading in future?


----------



## joe5000 (Sep 11, 2011)

In addition: pkg_info shows both versions of perl available. But *perl -v* shows perl 5.10. 

/etc/make.conf has 5.10 entry


----------



## jb_fvwm2 (Sep 11, 2011)

```
portmaster -i -d -B /var/db/pkg/apache... /var/db/pkg/mc-..
```
 *Almost* without fail, you would answer NO to any unwanted perl install.  However, pkg_add is not under such user control at all times.

```
cd /var/db/pkg
ls -lac | grep perl
```
 should show which perl(s) are installed. Maybe deinstall the perl you do not wish to have installed ? 
(Short answer anyway.)


----------



## joe5000 (Sep 11, 2011)

portmaster command did not work. But second command shows two versions of perl installed. But system uses older perl. I tried pkg_delete for both versions of perl. Due to different dependencies, unable to delete either. How to make all dependencies use the latest version?


----------



## wblock@ (Sep 11, 2011)

See the several entries about Perl in /usr/ports/UPDATING, most of which refer back to the 20100715 entry.  It might help to force-delete the newer version first with -f to pkg_delete(1).

perl-5.12 is the standard version right now.


----------



## anomie (Sep 11, 2011)

@joe5000: this might be a symptom of mixing Ports with packages, at least in the case of Apache web server. As for building Ports, try putting this in /etc/make.conf

```
PERL_VERSION=5.14.1
```

If that doesn't work, it _might_ (haven't tested it) be possible to have both working versions of Perl installed. Your scripts that need the 5.14 branch would need to point to its interpreter, rather than the generic (symlinked) /usr/bin/perl.


----------



## jb_fvwm2 (Sep 11, 2011)

```
pkg_delete -f /var/db/pkg/perl ...
```
 then maybe run portmaster on any program that does not work because it was deleted. (Will be shown in the output from that command, which ones... the contents of +REQUIRED_BY
........
/edit/, duplicate to the reply above mostly...
........


----------



## joe5000 (Sep 13, 2011)

It looks like FreeBSD packages install whatever perl version they like, ignoring existing higher version.

I noticed that two versions of perl installed on my machine. Packages install the perl they want under /usr/local/bin/ directory and create /usr/bin/perl and /usr/local/bin/perl5 symbolic links.

They say if I insert 
	
	



```
PERL_VERSION=5.14.1
```
 in /etc/make.conf, then packages/ports will not dare to change it. (not tested)

Ok, now, I get 5.14 version with *perl -v* command. I tried to run cpan to install some modules. There I had a new problem to report to Houston. Module installation gets stuck during testing at t/INSTALL_BASE.t, can exit only with ctrl-c.

This fellow had the same problem: http://www.nntp.perl.org/group/perl.makemaker/2011/09/msg3276.html
This fellow also mentions some regex error: http://www.perlmonks.org/?node_id=918598

I chatted in perl irc about it. Perl guys suspect some bug with FreeBSD.

FYI: I run FreeBSD 8.2 under vmware player 3.1.


----------



## anomie (Sep 15, 2011)

joe5000 said:
			
		

> I tried to run cpan to install some modules.



May be better to _not_ install Perl modules on FreeBSD that way. What's the module? Is it not in Ports already? 

You can search like: 

```
%cd /usr/ports && make search display=path name='p5.*graph'
Path:	/usr/ports/biology/p5-Bio-Graphics

Path:	/usr/ports/databases/p5-GraphViz-DBI

Path:	/usr/ports/devel/p5-B-Graph

Path:	/usr/ports/graphics/p5-Acme-Steganography-Image-Png

Path:	/usr/ports/graphics/p5-Chart-Graph

Path:	/usr/ports/graphics/p5-Chart-PNGgraph

Path:	/usr/ports/graphics/p5-GD-Graph

...
```

Or you can search on Freshports.


----------



## apiper (Dec 13, 2011)

I've just encountered this problem. Setting 
	
	



```
PERL_VERSION=5.14.1
```
 in /etc/make.conf didn't help, but setting 
	
	



```
PERL_PORT=perl5.14
```
 in /etc/make.conf fixed the problem for me.

There's probably many good reasons not setting PERL_PORT in /etc/make.conf (otherwise someone would have already suggested doing this), but I'm on a tight deadline and it fixed my immediate problem... ï¿½e


----------



## anomie (Dec 13, 2011)

If it's working (and you have thoroughly tested), then it's good info for this thread.


----------

