0

Possible Duplicate:
What's the easiest way to install a missing Perl module?

I downloaded the source code for a perl script. When I try to run it, however, it gives me the following error:

Can't locate Palm/PDB.pm in @INC (@INC contains: /root/Desktop /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at /etc/perl/MobiPerl/MobiFile.pm line 3.
BEGIN failed--compilation aborted at /etc/perl/MobiPerl/MobiFile.pm line 3.
Compilation failed in require at ./html2mobi line 21.
BEGIN failed--compilation aborted at ./html2mobi line 21.

What can I possibly do to run this script?

Community
  • 1
  • 1
user1092042
  • 1,297
  • 5
  • 24
  • 44
  • If you're using this module, you might consider adopting it. It needs a maintainer since the current one is pretty lazy. :) – brian d foy May 06 '12 at 19:34

2 Answers2

4

You need to download the right module from CPAN - in this case, Palm::PDB

Answers to this question explain how to install missing Perl modules.

Community
  • 1
  • 1
andrewsi
  • 10,807
  • 132
  • 35
  • 51
2

You will need to find and install the module Palm::PDB from somewhere. It is available on CPAN.

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
  • Thanks. If i want this perl script to be run on its own without the user having to install any libraries how would i package it into the script. – user1092042 May 05 '12 at 05:59
  • OKay. But is it atleast possible to make this perl script listen on a particular port for it to function as a web service. – user1092042 May 05 '12 at 06:13
  • I deleted a comment to the effect "You can't do that". To a first approximation, it was accurate. This is a refinement. You wouldn't normally do that. I suppose you could try embedding the actual Palm::PDB module code into your script if it is a pure Perl module; if it uses the XS interface (calling C functions from Perl), then you simply can't do it. – Jonathan Leffler May 05 '12 at 06:15
  • Could you please look at my next comment – user1092042 May 05 '12 at 06:17
  • It could be done, but would probably require a fair few Perl modules to make it work, which is replacing a little problem with a bigger one. I've not tried Palm::PDB, so I don't know what its dependencies are. But Perl is meant to be a modular language, and people write their modules using other modules, and the other modules use still other modules, and so on. On the whole, you are making more trouble for yourself by fighting against the grain. – Jonathan Leffler May 05 '12 at 06:18
  • Okay. So what would your suggestion be. I have a perl script which works fine. I need to call this perl script from e firfox add-onn. So it has to be available on a central server. How would i go about achiving this.(The addonn is being written by me). – user1092042 May 05 '12 at 06:21
  • I took a slightly less quick look at Palm::PDB; it doesn't have any awkward dependencies (Test::More and ExtUtils::MakeMaker), but it **is a pure Perl module** (note edit!). I have not explored the world of writing Firefox add-ons, so I have very little clue about how they work and how they're written. Perl can be made to talk over the internet to a web server; there's no particular rocket science there. Whether that's a sensible design or not is beyond my knowledge; I couldn't guess. – Jonathan Leffler May 05 '12 at 06:27
  • Okay. But i can write a socket program in perl which listnes for connections and calls another perl script on the server. This is possible right.( mY only worry is that firefox is in javascript. Can a javascript call the perl server). – user1092042 May 05 '12 at 06:39
  • Yes, that's possible (to write Perl scripts/programs that listen to sockets and connect to other programs, Perl scripts or otherwise, on a server); I said so. I don't know whether it is sensible; I said that, too. – Jonathan Leffler May 05 '12 at 06:41
  • Okay. Thanks a lot. I will get on to it – user1092042 May 05 '12 at 06:43