Perl library reload error

English! place to talk about development, programming and coding
Post Reply
dstover
Znuny advanced
Posts: 135
Joined: 04 Jun 2013, 23:14
Znuny Version: 3.3.3
Real Name: Dan Stover
Company: EMAC, Inc.

Perl library reload error

Post by dstover »

I have a custom library of Perl subroutines that is in a pm file. I need to include this in selected OTRS programs. Normally it works with a use statement (use EMAC::EmacOTRSLib;) but sometimes I get the following error message:

[Thu Apr 30 15:37:31 2015][Error][Kernel::Modules::AgentDashboardCommon::_Element][759] Attempt to reload EMAC/EmacOTRSLib.pm aborted.

Is there some way so that the library can be included and not have to worry about whether it is already loaded? Or another way to resolve this error?

Any input would be appreciated. Thanks in advance...Dan.
OTRS 3.3.3
Ubuntu 12.04
MySQL DB
tto
Znuny wizard
Posts: 315
Joined: 09 Jan 2007, 15:24
Znuny Version: OTRS 5.0.x
Real Name: Torsten
Company: c.a.p.e. IT GmbH
Location: Chemnitz
Contact:

Re: Perl library reload error

Post by tto »

dstover wrote:[...] Normally it works with a use statement (use EMAC::EmacOTRSLib;) but sometimes I get the following error message:
[Thu Apr 30 15:37:31 2015][Error][Kernel::Modules::AgentDashboardCommon::_Element][759] Attempt to reload EMAC/EmacOTRSLib.pm aborted.
[..]
I guess this is too little information for anyone to support you.

Is there any other or more error output?
Where is your module already loaded?
What does your module - does it some package-scope check in order to prevent multiple loading?
Do you have mod_perl enabled?
If so, does it work without mod_perl?

...etc...

regards, T.
--
KIX 17.x (fork of OTRS)
Professional KIX-, or OTRS-integration, development and consulting by c.a.p.e. IT - http://www.cape-it.de
For questions and hints regarding KIX(4OTRS) please go to https://forum.kixdesk.com/
Bei Fragen und Hinweisen zu KIX(4OTRS) bitte an https://forum.kixdesk.com/ wenden.
dstover
Znuny advanced
Posts: 135
Joined: 04 Jun 2013, 23:14
Znuny Version: 3.3.3
Real Name: Dan Stover
Company: EMAC, Inc.

Re: Perl library reload error

Post by dstover »

I am including this module via require in every OTRS module where it is in use. It is possible that it will already be loaded when another module that uses it is loaded. My understanding of the require statement is that only one copy is loaded. I have tried deleting the module from %INC to no avail. I learned Perl to modify OTRS and therefore may not know all the ins and outs. I believe that mod_perl is loaded. I have not tried it without mod_perl yet.

I am not aware of any package-scope checking that is being done, so probably none. I am not sure how to do that, I guess.

Thanks in advance for any further input...Dan.
OTRS 3.3.3
Ubuntu 12.04
MySQL DB
tto
Znuny wizard
Posts: 315
Joined: 09 Jan 2007, 15:24
Znuny Version: OTRS 5.0.x
Real Name: Torsten
Company: c.a.p.e. IT GmbH
Location: Chemnitz
Contact:

Re: Perl library reload error

Post by tto »

dstover wrote: I am not aware of any package-scope checking that is being done, so probably none. I am not sure how to do that, I guess.
...ok, so I guess it's not in there :-). However, you should provide a bit more information or answers to the questions I mentioned. Without that it's just guessing.

regards, T.
--
KIX 17.x (fork of OTRS)
Professional KIX-, or OTRS-integration, development and consulting by c.a.p.e. IT - http://www.cape-it.de
For questions and hints regarding KIX(4OTRS) please go to https://forum.kixdesk.com/
Bei Fragen und Hinweisen zu KIX(4OTRS) bitte an https://forum.kixdesk.com/ wenden.
Post Reply