You are not logged in.

#1 2006-02-26 12:58:57

PeteMo
Member
From: H'Burg, VA
Registered: 2006-01-26
Posts: 191
Website

[solved] problems with perl modules compiled via CPAN

Hi guys,

I've actually seen this problem before on other distros so I don't think it's an Arch specific question, but maybe you can help out.

I've got a perl script that uses SOAP::Lite.  I've installed it via CPAN.  When I run the script I get the error:

pmorris@arch:~/bin $ ./devel/weather/ndfdgen.pl
Can't locate object method "new" via package "SOAP::Packager::MIME" (perhaps you forgot to load "SOAP::Packager::MIME"?) at /usr/lib/perl5/site_perl/5.8.8/SOAP/Lite.pm line 3216.

I have installed SOAP::Packager, in addition to these SOAP related modules:

pmorris@arch:~/bin $ ./perl/installed_mods.pl | grep SOAP
SOAP -- 0.28
SOAP::Lite -- 0.67
SOAP::MIME -- 0.55

I have this exact script working on another machine running ubuntu, where all the modules were installed via ubuntu packages instead of CPAN.

EDIT: I just realized SOAP::Lite was available in the AUR.  I've installed it and the script now works fine!  What in the world?!  However, please continue reading as I have this problem with another module that is not in the AUR...

I've also seen this in another script, with a different module:

pmorris@arch:~/bin $ cdplayer.p;
Can't locate object method "first_track" via package "Audio::CD::Info" at /home/pmorris/bin/cdplayer.pl line 54.

Audio::CD is a perl module that allows control of a cd via libcdaudio.  I've install the library both via pacman and by compiling it myself with no change in the results.  I had the exact same problem with another machine running ubuntu, and using the ubuntu packaged modules solved the problem. 

I have no idea what is going on, and I've had my local perl guru look at it, and he's stumped too.  The only possible thing I can think of is that it has something to do with the distro packaged versions of perl.  I have not tried compiling my own copy of perl.  Do you think that would be worth a shot?  If so, how do I handle having two versions of perl installed on my system, because it looks like removing arch's version will break a bunch of packages.  Does anyone have any other ideas as to how to troubleshoot this?

If you think this would be better posted on a perl specific board, let me know.
Thanks,
Pete

Offline

#2 2006-02-26 13:14:38

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [solved] problems with perl modules compiled via CPAN

Any chance you installed the CPAN modules under perl 5.8.7, i.e. before the upgrade to 5.8.8? I had a similar problem in reverse - I built some modules on my testing machine with 5.8.8, and then found that they wouldn't run on my server, which still had 5.8.7 installed at the time. I always use PKGBUILDs for perl modules that aren't in the repos, so I can't comment on CPAN-installed ones.

I'm not sure about having two concurrent Perl versions, but as far as removing the Arch package is concerned, it won't break anything, as long as your own version provides the same functionality. However, pacman will think things are broken. You haven't said if you intend to create your own perl PKGBUILD, to be built and installed with makepkg/pacman, or if you're thinking of building perl directly from source, but either way, as long as everything ends up in the right directories, you should be OK. I'd have a preference for the makepkg/pacman route, in which case you should call your package something like perl-pmo, and make sure it conflicts with, and provides, perl.

Offline

#3 2006-02-26 13:55:49

PeteMo
Member
From: H'Burg, VA
Registered: 2006-01-26
Posts: 191
Website

Re: [solved] problems with perl modules compiled via CPAN

tomk wrote:

Any chance you installed the CPAN modules under perl 5.8.7, i.e. before the upgrade to 5.8.8?

Yeah, this is entirely possible.  Does this mean I'll have to reinstall all modules every time there is a new version of perl?

I've actually gotten the SOAP::Lite module working, via the AUR.  (see EDIT in my 1st post).  I make a pkgbuild for the Audio::CD module (my first) using the SOAP::Lite pkgbuild as a template.  The module seemed to build and install fine, but I had the same problem.  Could you take a look at the pkgbuild and see if I've done things right?

# PKGBUILD for the Audio::CD perl module
pkgname=perl-audio-cd
pkgver=0.04
pkgrel=1
pkgdesc="Audio::CD - Perl interface to libcdaudio (cd + cddb)"
url="http://search.cpan.org/~dougm/Audio-CD-0.04/CD.pm"
license=""
groups=
depends=('perl' 'libcdaudio')
makedepends=()
conflicts=()
replaces=()
backup=()
install=
source=(http://search.cpan.org/CPAN/authors/id/D/DO/DOUGM/Audio-CD-0.04.tar.gz)
md5sums=('5b3051fd01a36c557a54e83ac0bde567')

build() {
  cd $startdir/src/Audio-CD-0.04
  perl Makefile.PL
  chmod -R u+w *
  make || return 1
  make DESTDIR=$startdir/pkg install
  mv $startdir/pkg/usr/lib/perl5/site_perl/?.?.? $startdir/pkg/usr/lib/perl5/site_perl/current
  rm -rf $startdir/pkg/usr/lib/perl5/?.?.?
}

I'd actually perfer to avoid building my own perl, but if I do I will use the makepkg/pacman route you described - thanks for the tip there.

Offline

#4 2006-02-26 15:02:41

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [solved] problems with perl modules compiled via CPAN

Nothing major wrong with your PKGBUILD, AFAICS - two small things, not relevant to your problem, but the url field still refers to SOAP::Lite, and the source field should use $pkgver instead of hardcoding the version number.

Can you post the FILELIST for your package?

Offline

#5 2006-02-26 15:51:45

PeteMo
Member
From: H'Burg, VA
Registered: 2006-01-26
Posts: 191
Website

Re: [solved] problems with perl modules compiled via CPAN

Thanks for the heads up on the minor PKGBUILD errors - just me working too quickly...

Here's the filelist:

pmorris@arch:~/downloads/tmp/perl-audio-cd $ cat filelist
.FILELIST
.PKGINFO
usr/
usr/lib/
usr/lib/perl5/
usr/lib/perl5/site_perl/
usr/lib/perl5/site_perl/current/
usr/lib/perl5/site_perl/current/i686-linux-thread-multi/
usr/lib/perl5/site_perl/current/i686-linux-thread-multi/Audio/
usr/lib/perl5/site_perl/current/i686-linux-thread-multi/Audio/CD.pm
usr/lib/perl5/site_perl/current/i686-linux-thread-multi/auto/
usr/lib/perl5/site_perl/current/i686-linux-thread-multi/auto/Audio/
usr/lib/perl5/site_perl/current/i686-linux-thread-multi/auto/Audio/CD/
usr/lib/perl5/site_perl/current/i686-linux-thread-multi/auto/Audio/CD/.packlist
usr/lib/perl5/site_perl/current/i686-linux-thread-multi/auto/Audio/CD/CD.bs
usr/lib/perl5/site_perl/current/i686-linux-thread-multi/auto/Audio/CD/CD.so
usr/man/
usr/man/man3/
usr/man/man3/Audio::CD.3.gz

Offline

#6 2006-02-26 19:49:47

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [solved] problems with perl modules compiled via CPAN

Nothing wrong there either, that I can see. Can you post your script, or a link to it, and I'll see if it runs here?

Offline

#7 2006-02-26 20:10:54

PeteMo
Member
From: H'Burg, VA
Registered: 2006-01-26
Posts: 191
Website

Re: [solved] problems with perl modules compiled via CPAN

Here's a simple script that throws the error on my end:

#!/usr/bin/perl -w

use strict;
use Audio::CD;

my $cd = Audio::CD->init;
until ( my $info = $cd->stat->present ) {       # loop until cd is loaded
        system( "clear" );
        print "cd playern";
        print "please load cdn";
        sleep (1);
}

my $total_tracks = $cd->stat->total_tracks;
#$cd->play(1);
my $track = $cd->stat->first_track;

One thing I find interesting is that the method calls on line 6, 7, and 14 all work; it is the last one, on line 16 that causes the error, "Can't locate object method "first_track" via package "Audio::CD::Info" at ./audiocd_test.pl line 16."

Also, if you uncomment line 15, and comment line 16 in the script, no error is thrown, and the cd should start playing although it does not.  I tried this a both a user and as root thinking it could be a permissions problem somewhere with no luck.

Offline

#8 2006-02-26 21:38:31

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [solved] problems with perl modules compiled via CPAN

OK, here's what I get. With the script as posted, I get the same error as you. When I uncomment 15, comment 16, and run again, the cd plays - it's playing right now, actually.

Does that help you at all? If you need any more info about my setup, let me know.

Offline

#9 2006-02-26 22:15:02

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [solved] problems with perl modules compiled via CPAN

Here's something else, but before I post, I'd like to say that I've never written any perl of any sort, so if I'm talking absolute crap, please be gentle......

The problematic line 16 refers to first_track, but there is no mention of first_track on CPAN's Audio::CD page. Does that matter?

Offline

#10 2006-02-26 23:36:20

PeteMo
Member
From: H'Burg, VA
Registered: 2006-01-26
Posts: 191
Website

Re: [solved] problems with perl modules compiled via CPAN

tomk wrote:

The problematic line 16 refers to first_track, but there is no mention of first_track on CPAN's Audio::CD page. Does that matter?

Holy crap!  You've gotta be kidding me!  Sometimes it takes someone unfamiliar with a program to see those obvious things.  You've hit the nail on the head...I wrote this script on an ubuntu box and debian has a newer vesion of the audio::cd module - not sure how that works, but...anyway, debian's (and by extension, ubuntu's) version of Audio::CD has additional functions, such as first_track.  I'm going to persue this on that end.

In the meantime, I'm still not getting any sound from the sample script I posted earlier, although I can listen to the cd fine via BMP, using the ALSA plugin.  I don't get any warnings from the script, it ends, and the music never starts.  I believe for you the script should end, but the music continues playing? 

Thanks for your help.

Offline

#11 2006-02-27 00:01:28

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [solved] problems with perl modules compiled via CPAN

pmo6022 wrote:

debian has a newer vesion of the audio::cd module

That has to be a first.......! tongue

pmo6022 wrote:

I believe for you the script should end, but the music continues playing?

Exactly what happens.

Offline

#12 2006-02-27 00:42:42

PeteMo
Member
From: H'Burg, VA
Registered: 2006-01-26
Posts: 191
Website

Re: [solved] problems with perl modules compiled via CPAN

tomk wrote:
pmo6022 wrote:

debian has a newer vesion of the audio::cd module

That has to be a first.......! tongue

Hahaha  big_smile Yeah, I'm shocked too. 

I got the sound working, it was just something muted in alsamixer.  I'm marking this [solved], and I'll report back once I figure out how debian managed to get a newer version.

Thanks very much for your help on this, tomk.

Offline

Board footer

Powered by FluxBB