LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-11-2013, 11:10 AM   #1
gregAstley
LQ Newbie
 
Registered: Aug 2012
Distribution: ubuntu 11.10
Posts: 27

Rep: Reputation: 4
Perl: cannot use: "use v5.14"


I have just upgraded my version of perl to 5.18 in an attempt to try and fix this one but it didn't work. Essentially, the following "program"

#!/usr/bin/perl
use v5.14;

fails to run with the error:

Perl v5.14.0 required--this is only v5.12.4, stopped at ./Perl line 2.
BEGIN failed--compilation aborted at ./Perl line 2.


I have tried copy pasting sections of the error string into google and though I get a few hits I have found nothing that can help me with this one...anybody got any ideas?
 
Old 08-11-2013, 01:42 PM   #2
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,870
Blog Entries: 1

Rep: Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871
Either your Perl is lying, or it is really version 5.12.4

Code:
perl -v
which perl
dpkg -l perl
 
1 members found this post helpful.
Old 08-11-2013, 01:59 PM   #3
gregAstley
LQ Newbie
 
Registered: Aug 2012
Distribution: ubuntu 11.10
Posts: 27

Original Poster
Rep: Reputation: 4
Quote:
Originally Posted by NevemTeve View Post
Either your Perl is lying, or it is really version 5.12.4

Code:
perl -v
which perl
dpkg -l perl
Firstly, thatnks for the response, and secondly, wow...this is wierd, firstly, the new installation seems to have had no effect (configure, make, make install seemed to work), and finally, my output from those commands is as follows:

Code:
greg@greg-Aspire-5742:~$ perl -v

This is perl 5, version 14, subversion 0 (v5.14.0) built for i686-linux

Copyright 1987-2011, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

greg@greg-Aspire-5742:~$ which perl
/home/greg/perl5/perlbrew/perls/perl-5.14.0/bin/perl
greg@greg-Aspire-5742:~$ dpkg -l perl
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version        Description
+++-==============-==============-============================================
ii  perl           5.12.4-4ubuntu Larry Wall's Practical Extraction and Report
greg@greg-Aspire-5742:~$

this can't be healthy :/

Last edited by gregAstley; 08-11-2013 at 03:05 PM.
 
Old 08-11-2013, 11:16 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,362

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
You're pointing at 2 different installs
Code:
/usr/bin/perl    # evidently perl 5.12

perl     # evidently 5.14 in path /home/greg/perl5/perlbrew/perls/perl-5.14.0/bin/perl
Just change the path at the top of the perl program OR put a symlink there to point at the 5.14 OR insert the 5.14 path in $PATH before /usr/bin.
 
1 members found this post helpful.
Old 08-12-2013, 02:00 PM   #5
gregAstley
LQ Newbie
 
Registered: Aug 2012
Distribution: ubuntu 11.10
Posts: 27

Original Poster
Rep: Reputation: 4
Quote:
Originally Posted by chrism01 View Post
You're pointing at 2 different installs
Code:
/usr/bin/perl    # evidently perl 5.12

perl     # evidently 5.14 in path /home/greg/perl5/perlbrew/perls/perl-5.14.0/bin/perl
Just change the path at the top of the perl program OR put a symlink there to point at the 5.14 OR insert the 5.14 path in $PATH before /usr/bin.
I opted for the symlink option (I was tempted to nuke the 5.12, 5.14, and recently (though ineffectually) the install of 5.18 but was worried I might break something in the process)

It all works - thanks for that :]
 
Old 08-12-2013, 02:39 PM   #6
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,870
Blog Entries: 1

Rep: Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871
Usually, locally compiled programs go into /usr/local (./configure --prefix=/usr/local), and script-headers often points there, too:

Code:
#!/usr/local/bin/php
...
But, if you don't have locally compiled PHP, you are to create a symlink: ln -s /usr/bin/php /usr/local/bin/php

Last edited by NevemTeve; 08-12-2013 at 11:19 PM. Reason: hash-bang fixed
 
Old 08-12-2013, 03:10 PM   #7
gregAstley
LQ Newbie
 
Registered: Aug 2012
Distribution: ubuntu 11.10
Posts: 27

Original Poster
Rep: Reputation: 4
Quote:
Originally Posted by NevemTeve View Post
Usually, locally compiled programs go into /usr/local (./configure --prefix=/usr/local), and script-headers often points there, too:

Code:
#/usr/local/bin/php
...
But, if you don't have locally compiled PHP, you are to create a symlink: ln -s /usr/bin/php /usr/local/bin/php
Thanks, for what its worth, I did have a look at what is inside my /usr/local directory and with the exception of some xml related binaries there is nothing useful in there for me. As per my response to chrism01 above however, all is now well again :]
 
Old 08-12-2013, 11:19 PM   #8
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,870
Blog Entries: 1

Rep: Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871
Certainly, as you've compiled your perl with configure-option --prefix=/home/greg/perl5/perlbrew/perls/perl-5.14.0
That's okay if you are only experimenting; but if you actually want to use it, --prefix=/usr/local is a better idea.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Perl: how to save an e-mail attachment on disk keeping the "&" character (no "%26"!!) d1s4st3r Programming 5 09-29-2010 09:30 PM
Perl - Can't use string ("html") as an ARRAY ref while "strict refs" OldGaf Programming 9 08-11-2009 11:14 AM
"Failed Dependency error" while installing RPM for "DateTime" perl modules giridhargopal.cj Linux - Newbie 7 11-19-2008 12:05 AM
problem "make"ing gtk+ "/usr/bin/env: perl -w" caid Linux - Newbie 8 07-29-2005 04:51 AM
LFS 4.1: Stalled at Perl, "missing seperator" error from "make" SparceMatrix Linux From Scratch 1 06-07-2003 03:31 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:01 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration