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."