Unix Technical Forum

Perl problems with Slack 11

This is a discussion on Perl problems with Slack 11 within the Slackware Linux Support forums, part of the Unix Operating Systems category; --> I have been unable to get anything from my old perl programs to run under 5.8.8. So I ripped ...


Go Back   Unix Technical Forum > Unix Operating Systems > Slackware Linux Support

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-20-2008, 07:40 PM
root
 
Posts: n/a
Default Perl problems with Slack 11

I have been unable to get anything from my old perl programs
to run under 5.8.8. So I ripped out everything to start from
scratch. Running one of my old perl programs I get:

Can't locate Config/IniFiles.pm in @INC (@INC contains: /usr/lib/perl5/5.8.8/i486-linux
/usr/lib/perl5/5.8.8 /usr/lib/perl5/site_perl/5.8.8/i486-linux /usr/lib/perl5/site_perl/5.8.8
/usr/lib/perl5/site_perl .)

But when I try to fetch the package:
cpan[1]> install Config::IniFiles
CPAN: Storable loaded ok
Going to read /root/.cpan/Metadata
Database was generated on Wed, 01 Nov 2006 02:23:19 GMT
Config::IniFiles is up to date (2.38).

Perl can see it, why can't my script?

At the top of the script I have #!/usr/bin/perl which points to
perl5.8.8.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-20-2008, 07:41 PM
zentara
 
Posts: n/a
Default Re: Perl problems with Slack 11

On Wed, 01 Nov 2006 10:54:23 GMT, root <NoEMail@home.org> wrote:

>I have been unable to get anything from my old perl programs
>to run under 5.8.8. So I ripped out everything to start from
>scratch. Running one of my old perl programs I get:
>
>Can't locate Config/IniFiles.pm in @INC (@INC contains: /usr/lib/perl5/5.8.8/i486-linux
> /usr/lib/perl5/5.8.8 /usr/lib/perl5/site_perl/5.8.8/i486-linux /usr/lib/perl5/site_perl/5.8.8
>/usr/lib/perl5/site_perl .)
>
>But when I try to fetch the package:
>cpan[1]> install Config::IniFiles
>CPAN: Storable loaded ok
>Going to read /root/.cpan/Metadata
> Database was generated on Wed, 01 Nov 2006 02:23:19 GMT
>Config::IniFiles is up to date (2.38).
>
>Perl can see it, why can't my script?
>
>At the top of the script I have #!/usr/bin/perl which points to
>perl5.8.8.


I don't know, but try to install manually, not using cpan shell.

Get the latest version 2.39
http://search.cpan.org/~wadg/Config-IniFiles-2.38/

unpack it, then
perl Makefile.PL
make
make install ( as root)


If your script still dosn't work, it is probably a problem with
your script. Maybe a binary-incompatibility, or the error message
is mis-leading.

There are alot of factors. Did you build Perl 5.8.8 yourself or is it a
binary rpm? It always works best when you build it yourself.



--
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-20-2008, 07:41 PM
Sylvain Robitaille
 
Posts: n/a
Default Re: Perl problems with Slack 11

zentara wrote:

> If your script still dosn't work, it is probably a problem with
> your script. Maybe a binary-incompatibility, ...


That's nonsense: the whole point of using a scripting language is that
by definition, the script will not suffer from "binary incompatibility".
It's a text file that's interpretted, in this case by the Perl binary
that has been shown to at least basically work.

> There are alot of factors. Did you build Perl 5.8.8 yourself or is it
> a binary rpm?


The system is Slackware (as mentioned in the subject line of the
original message). I doubt the OP used an rpm, though he may have
installed Perl from the OS distribution disk ...

> It always works best when you build it yourself.


Generally I find that to be true in some cases (Perl being one of them),
and not necessarily so (ie, "works just as well either way") in others.

--
----------------------------------------------------------------------
Sylvain Robitaille syl@alcor.concordia.ca

Systems and Network analyst Concordia University
Instructional & Information Technology Montreal, Quebec, Canada
----------------------------------------------------------------------
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-20-2008, 07:41 PM
root
 
Posts: n/a
Default Re: Perl problems with Slack 11

zentara <zentara@highstream.net> wrote:
>
> I don't know, but try to install manually, not using cpan shell.
>
> Get the latest version 2.39
> http://search.cpan.org/~wadg/Config-IniFiles-2.38/
>
> unpack it, then
> perl Makefile.PL
> make
> make install ( as root)
>


I'll have to boot into a different partition to try it. I did
the tests in a spare copy of my system.


>
> If your script still dosn't work, it is probably a problem with
> your script. Maybe a binary-incompatibility, or the error message
> is mis-leading.
>


The script had been working before the upgrade to 5.8.8, and it
bombs at:
use Config::IniFiles

> There are alot of factors. Did you build Perl 5.8.8 yourself or is it a
> binary rpm? It always works best when you build it yourself.
>


I installed the perl package from Slackware, just as I have always done.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-20-2008, 07:41 PM
root
 
Posts: n/a
Default Re: Perl problems with Slack 11

Sylvain Robitaille <syl@alcor.concordia.ca> wrote:
> zentara wrote:
>
>> There are alot of factors. Did you build Perl 5.8.8 yourself or is it
>> a binary rpm?

>
> The system is Slackware (as mentioned in the subject line of the
> original message). I doubt the OP used an rpm, though he may have
> installed Perl from the OS distribution disk ...
>


I first installed the package from the 11.0 installation disk.
Then I went to slackware and downloaded the package specifically.
Same result.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-20-2008, 07:41 PM
root
 
Posts: n/a
Default Re: Perl problems with Slack 11

zentara <zentara@highstream.net> wrote:
>
> Get the latest version 2.39
> http://search.cpan.org/~wadg/Config-IniFiles-2.38/
>
> unpack it, then
> perl Makefile.PL
> make
> make install ( as root)
>


The program uses several other packages besides Config::IniFiles.
After downloading and making each the original script worked.

So, that means the perl:
perl -MCPAN -e 'install <some package>'
doesn't work, nor does it work if I pull up a shell
and say install.

Seems like a real pain in the ass to have to fetch and
build everything I ever needed from CPAN.

Thanks for your help.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 02-20-2008, 07:41 PM
zentara
 
Posts: n/a
Default Re: Perl problems with Slack 11

On Wed, 1 Nov 2006 16:15:02 +0000 (UTC), Sylvain Robitaille
<syl@alcor.concordia.ca> wrote:

>zentara wrote:
>
>> If your script still dosn't work, it is probably a problem with
>> your script. Maybe a binary-incompatibility, ...

>
>That's nonsense: the whole point of using a scripting language is that
>by definition, the script will not suffer from "binary incompatibility".
>It's a text file that's interpretted, in this case by the Perl binary
>that has been shown to at least basically work.


Not if the script uses an module which contains an xs component
that wasn't rebuilt, and when he built the 5.8.8 version, he may have
opted to include his old 5.6.1 modules in @INC.
Modules containing an xs component, built under 5.6.1 are
NOT binary compatible with 5.8.8.

There are many perl modules with c components.

He didn't show the script, so I had the right to guess.
Sometimes the error messages, which you get from Perl
can be misleading. It may have reported it couldn't find
a module, but in reality it may not have been loadable.



--
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 02-20-2008, 07:41 PM
root
 
Posts: n/a
Default Re: Perl problems with Slack 11

zentara <zentara@highstream.net> wrote:
> On Wed, 1 Nov 2006 16:15:02 +0000 (UTC), Sylvain Robitaille
><syl@alcor.concordia.ca> wrote:
>
>>zentara wrote:
>>
>>> If your script still dosn't work, it is probably a problem with
>>> your script. Maybe a binary-incompatibility, ...

>>
>>That's nonsense: the whole point of using a scripting language is that
>>by definition, the script will not suffer from "binary incompatibility".
>>It's a text file that's interpretted, in this case by the Perl binary
>>that has been shown to at least basically work.

>
> Not if the script uses an module which contains an xs component
> that wasn't rebuilt, and when he built the 5.8.8 version, he may have
> opted to include his old 5.6.1 modules in @INC.
> Modules containing an xs component, built under 5.6.1 are
> NOT binary compatible with 5.8.8.
>
> There are many perl modules with c components.
>
> He didn't show the script, so I had the right to guess.
> Sometimes the error messages, which you get from Perl
> can be misleading. It may have reported it couldn't find
> a module, but in reality it may not have been loadable.
>
>


Would the script fail at the line:
use Config::Inifiles

if there were c components in the module? I would guess
that it would fail earlier.

BTW, there were no other perl components in the system, it was
a virgin 5.8.8 installed from the Slack 11 install disk. Subsequently
I removed the package, downloaded the perl source from cpan, and
built the package myself. There was no change. I was only able
to get the script to work if I separately downloaded the component
modules and built them individually.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 02-20-2008, 07:42 PM
Kees Theunissen
 
Posts: n/a
Default Re: Perl problems with Slack 11

root wrote:
> I have been unable to get anything from my old perl programs
> to run under 5.8.8. So I ripped out everything to start from
> scratch. Running one of my old perl programs I get:
>
> Can't locate Config/IniFiles.pm in @INC (@INC contains: /usr/lib/perl5/5.8.8/i486-linux
> /usr/lib/perl5/5.8.8 /usr/lib/perl5/site_perl/5.8.8/i486-linux /usr/lib/perl5/site_perl/5.8.8
> /usr/lib/perl5/site_perl .)
>
> But when I try to fetch the package:
> cpan[1]> install Config::IniFiles
> CPAN: Storable loaded ok
> Going to read /root/.cpan/Metadata
> Database was generated on Wed, 01 Nov 2006 02:23:19 GMT
> Config::IniFiles is up to date (2.38).


If you installed Config::IniFiles from CPAN on Slackware 10.2
if will probably be installed somewhere under
/usr/lib/perl5/site_perl/5.8.7/
And the @INC array contains only paths with a 5.8.8 component.
Adjusting that array might solve your problem.
No, I don't know how to do that.

>
> Perl can see it, why can't my script?


Seems like CPAN looks at more places than just @INC.

>
> At the top of the script I have #!/usr/bin/perl which points to
> perl5.8.8.


There is probably an other complication.
I installed SpamAssassin from CPAN with some required or optional
packages. Look at this:

kees@pcict9:~$ head -n 1 `which spamassassin sa-learn sa-update`
==> /usr/bin/spamassassin <==
#!/usr/bin/perl5.8.7 -T -w

==> /usr/bin/sa-learn <==
#!/usr/bin/perl5.8.7 -T -w

==> /usr/bin/sa-update <==
#!/usr/bin/perl5.8.7 -T -w

This will certainly bring troubles if the perl version changes.
And CPAN will just say ".... is up to date (version)." if you try
to reinstall the packages.

I only have SpamAssassin with a few additional packages installed
from CPAN. The last two times I upgraded perl I solved this problem
with brute force.
Something like:
-- Do a normal slakware upgrade.
-- Search for all directories with 'perl' in their names and
recursively delete all directories you find.
-- Go to /var/log/packages and do 'grep -l perl *`
-- Reinstall all packages found during the precious step.
-- Reinstall SpamAssassin and friends from CPAN.

Yes, I already said it was brute force.
And ... erm ..., yes. I _do_ shame. .... A lot even.
But it _did_ cleanup my perl environment.

My switch to Slack 11 will be on a new computer, one of these days.
So this time I won't need brute force.

There should be a better way. But I couldn't find it when needed.
Lately I found something about a 'autobundle' perl package that sould
make it possible to create a single bundle of all installed perl
packages and reinstall/update that bundle at once.
I didn't use it and don't know the details yet.

Regards,

Kees.

--
Kees Theunissen.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 02-20-2008, 07:42 PM
Sylvain Robitaille
 
Posts: n/a
Default Re: Perl problems with Slack 11

zentara wrote:

> Modules containing an xs component, built under 5.6.1 are
> NOT binary compatible with 5.8.8.


I'll buy that, though I don't have the impression from the OP's followup
that it is the case here ...

--
----------------------------------------------------------------------
Sylvain Robitaille syl@alcor.concordia.ca

Systems and Network analyst Concordia University
Instructional & Information Technology Montreal, Quebec, Canada
----------------------------------------------------------------------
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:37 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com