0

I have recently upgrade bugzilla [on Debian GNU/Linux 6.0.3 (squeeze)] (to the latest version and although it seems to work, I have an external script for integrating it with PlasticSCM source control which gives out the following error:

Can't locate Email/Sender/Simple.pm in @INC (@INC contains: . /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 Bugzilla/Mailer.pm line 27.

The stack trace keeps going all the way up to my custom script. but I think it is not relevant.

Line 27 in Bugzilla/Mailer.pm says:

use Email::Sender::Simple qw(sendmail);

And I assumed that the problem was that
Thinking that the issue was that the module Email::Sender::Simple was missing.

Bugzilaa has a script called ./checksetup.pl that is used for checking that all the prerequirements are met. When I am trying to run this script it does not indicate anything missing.

However, when it Does find missing libraries it gives instructions to add them using the a command with the structure:

 /usr/bin/perl install-module.pl HTML::FormatText::WithLinks

So I executed:

 /usr/bin/perl install-module.pl Email::Sender:Simple

Which said:

Checking for                 CPAN (v1.81)     ok: found v1.9402
Checking for                 YAML (any)       ok: found v1.15
Checking for   ExtUtils-MakeMaker (v6.31)     ok: found v7.1
CPAN: Storable loaded ok (v2.20)
Going to read '/MYUSERNAME/.cpan/Metadata'
  Database was generated on Mon, 30 Nov 2015 07:17:02 GMT
Installing Email::Sender:Simple version 1.300021...
Email::Sender::Simple is up to date (1.300021).

So it looks like it installed the module but running the CGI script again results in exactly the same stack trace.

Also running the install-module.pl script again returns the same result again (as if it has just installed it again...).

How can I tell If this module is installed (and where) or not and what can I do to make my script work?

UPDATE: I think i know where the problem is.
The cgi script that I am trying to run has the following line for its first line:

#!/usr/bin/perl -wT

from here: https://stackoverflow.com/a/2526809/25412 I understand that the T flag causes . not to be part of @INC (i.e. Perls module search path) so this is why the lib folder that my bugzilla's installation folder (which is also where the cgi is) is not used and the file lib/Email/Sender/Simple.pm that is inside it is being ignored by the CGI.

So the updated Q is - should I:
1. Remove the T from the first line of the cgi? or
2. Somehow (and how?) install EMAIL::Sender::Simple to some other location that is a part of the @INC ?

I tend think the answer should be the 2 beacuse I think the T flag is there for some security reasons because this page says :

"It's a good idea to turn them on explicitly for programs that run on behalf of someone else whom you might not necessarily trust, such as CGI programs or any internet servers you might write in Perl."

Community
  • 1
  • 1
epeleg
  • 10,347
  • 17
  • 101
  • 151
  • 2
    What is that `install-module.pl` file? Never seen that before. In debian, you would use apt-get, I suspect. E.g. `apt-get install libfoo-perl`. Or use the cpan utility `cpan Email::Sender::Simple`. And of course, you'd need to install as the correct user with reference to where your perl program is looking. – TLP Nov 30 '15 at 10:55
  • I am not a Perl person in any way, the `install-module.pl` is part of bugzilla. when running bugzillas `./checksetup.pl` script if it finds missing modules it shows command to execute in order to install them. those commands have the form `/usr/bin/perl install-module.pl Email::Sender:Simple`. – epeleg Nov 30 '15 at 11:54
  • You probably have PERL5LIB set in one environment, but not the other. – ikegami Nov 30 '15 at 18:29

1 Answers1

1

You can check module's installation path using this command:

perldoc -l Email::Sender::Simple

If it is not install it will give the below output:

No documentation found for "Email::Sender::Simple".

Else it will give the full path of that module.

serenesat
  • 4,611
  • 10
  • 37
  • 53
  • Note, due to some bugs, some installed modules could not get registered. See [cpanm does not register all installed modules in perllocal.pod](http://stackoverflow.com/questions/32679413/cpanm-does-not-register-all-installed-modules-in-perllocal-pod) – Håkon Hægland Nov 30 '15 at 11:32
  • trying to run this I get `You need to install the perl-doc package to use this program.`. – epeleg Nov 30 '15 at 11:55
  • @epeleg: `apt-get install perl-doc` – serenesat Nov 30 '15 at 12:18
  • `perldoc -l Email::Sender::Simple` returns `No documentation found for "Email::Sender::Simple"`. so the Q remains why does install-module.pl thinks its installed... and how can I convince it to uninstall or reinstall... – epeleg Nov 30 '15 at 13:00
  • @Håkon Hægland, `perldoc -l` doesn't use perllocal. – ikegami Nov 30 '15 at 18:28
  • @epeleg: What is install-module.pl file? You are not very clear with your question. Show us how and where you are using this module and what errors/warnings you are getting. That might be helpful for us and you. – serenesat Dec 01 '15 at 05:04
  • I have explained that in one of the comments on the Question. I have now edited the Q to better explain. and also added an update about new things I learned. – epeleg Dec 01 '15 at 13:26