CentOS definitely has its system perl executable in /usr/bin.<br><br>As Mike suggested, you should probably be a normal user for doing the configure and make test. You'll need to sudo the make install if you want to put it in /usr/local but not if under $HOME.<br>
<br>Good luck,<br>Rob<br><br><div class="gmail_quote">On Thu, Jan 15, 2009 at 9:31 AM, Mike South <span dir="ltr"><<a href="mailto:msouth@gmail.com">msouth@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="Wj3C7c">On Wed, Jan 14, 2009 at 10:36 PM, J C <<a href="mailto:jim.x.casey@gmail.com">jim.x.casey@gmail.com</a>> wrote:<br>
> Hi,<br>
><br>
> I bought the O'Reilly 5th edition Learning Perl the other day and it's<br>
> great. I am new to programming and Perl as well. I do know my way<br>
> around Linux but I am having problems upgrading from the version that<br>
><br>
> was on my OS (Cent OS 5.2) to 5.10. I downloaded Perl 5.10 from<br>
> <a href="http://www.cpan.org/authors/id/R/RG/RGARCIA/perl-5.10.0.tar.gz" target="_blank">http://www.cpan.org/authors/id/R/RG/RGARCIA/perl-5.10.0.tar.gz</a>, then<br>
><br>
> tar -xvzf perl-5.10.0.tar.gz the package in /usr/local/bin I then<br>
> followed the README guide that said to:<br>
><br>
> ./Configure -des -Dprefix=$HOME/localperl<br>
> make test<br>
> make install<br>
><br>
> Now, the first command was probably my mistake because I really have<br>
><br>
> no idea what that would do. I figured that I could simply use the<br>
> shebang after make test and make install was done "doing it's thing"<br>
> and type out #!/usr/local/bin/perl-5.10.0 or #!/usr/local/bin/<br>
><br>
> perl-5.10 and everything was work just fine and I would be using Perl<br>
> 5.10 This obviously is not the case as now it tells me I still have<br>
> 5.8.8 installed. I know this is probably a very common problem and<br>
> I'll try and do all the research I can when I find the time but if any<br>
><br>
> of you that are a lot more experienced could help me out and "put me<br>
> in the right direction" that would be great.<br>
><br>
> Here is the code from the book (page 68) I am trying to run:<br>
> ---------------------------------------------------------------------------------------<br>
><br>
> #!/usr/local/bin/perl-5.10.0 # I've also used perl5.10 and every<br>
> other thing I could think of...<br>
> use 5.010;<br>
> use strict;<br>
><br>
> sub marine {<br>
> $n += 1;<br>
> print "Hello, sailor number $n!\n";<br>
><br>
> }<br>
><br>
> &marine;<br>
> &marine;<br>
> &marine;<br>
> ----------------------------------------------------------------------------------------<br>
> And here is the output I am getting when I try running it:<br>
> Perl v.5.10.0 required --this is only v.5.8.8<br>
><br>
> ----------------------------------------------------------------------------------------<br>
><br>
> I've also noticed that now there's a perl5.10.0 located in the /root/<br>
><br>
> localperl/bin so I am sure it has something to do with the<br>
> above .Configure command.<br>
<br>
</div></div>You are right--what you have done is said "I want to make an<br>
installation of perl 5.10 in /root/localperl". The idea of that<br>
configuration option (which would normally be done as a regular user)<br>
is that you can experiment with the new version of perl in your own<br>
local directory (hence the $HOME) even if you don't have root access<br>
to the machine you are working on.<br>
<div class="Ih2E3d"><br>
>Can anyone give me some advice on how to get<br>
> 5.10 working? I feel like I am close, but nothing so far.<br>
<br>
</div>Well, one thing you can try, just to see if what you did worked, is<br>
change the shebang line in your test script to<br>
<br>
#!/root/localperl/bin/perl<br>
<br>
But I'm not sure what the permissions on /root/localperl are going to<br>
be. So, unless you run it as root, you might just get an error that<br>
says you don't have permission to run that. The idea of that<br>
configure command is that you run the configure command as the user<br>
you are going to run perl as.<br>
<br>
You might just want to start over and do this as a regular user. Make<br>
a directory called src/ in your home directory, copy<br>
perl-5.10.0.tar.gz to that directory, and unpack it there (tar xzvf as<br>
you did before). Then run the configure, make, make install just like<br>
you did before. This time you should end up with a directory called<br>
<br>
/home/jcasey/localperl/bin<br>
<br>
and it will have the perl 5.10 executable in it.<br>
<br>
So a shebang line of<br>
<br>
#!/home/jcasey/localperl/bin/perl<br>
<br>
should then work.<br>
<br>
You might want to just make sure that it works and everything before<br>
trying to overwrite the perl on your system, which the system may be<br>
using to get things done.<br>
<br>
[Rob's answer came in as I was writing this.]<br>
<br>
The way Rob suggested, rerunning configure with prefix set to<br>
/usr/local/, will put 5.10 in /usr/local/bin/perl. I think CentOS has<br>
perl in /usr/bin/perl. If that's right (you can check with "which<br>
perl"), and you do what Rob suggests, you will get 5.10 in<br>
/usr/local/bin/perl, and the system can keep using the perl it was<br>
already using, in /usr/bin/perl. That should be a pretty safe option,<br>
too, and is probably the normal way to do things.<br>
<br>
As the other perl mongers can tell you, I never come around to the<br>
normal way of doing things except by excessively circuitous routes.<br>
<font color="#888888"><br>
mike<br>
</font><div><div></div><div class="Wj3C7c"><br>
><br>
> thanks in advance,<br>
><br>
> jim<br>
><br>
> _______________________________________________<br>
> Raleigh-talk mailing list<br>
> <a href="mailto:Raleigh-talk@pm.org">Raleigh-talk@pm.org</a><br>
> <a href="http://mail.pm.org/mailman/listinfo/raleigh-talk" target="_blank">http://mail.pm.org/mailman/listinfo/raleigh-talk</a><br>
><br>
><br>
_______________________________________________<br>
Raleigh-talk mailing list<br>
<a href="mailto:Raleigh-talk@pm.org">Raleigh-talk@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/raleigh-talk" target="_blank">http://mail.pm.org/mailman/listinfo/raleigh-talk</a><br>
</div></div></blockquote></div><br>