Hours of "debugging" later, no real success.
(Many thanks to those who gave hints via private emails)
1) Modified my package so there's only one package/one object in the source.
2) Renamed the getuser() function so it's called MYgetuser
3) Calling code looks like this :
[-
sub BEGIN {
my $script = $0;
$script =~ s/^(.*)\/.*?$/$1/;
push @INC,$script;
push @INC,"$script/..";
}
use omicoldapcnx;
$req = shift;
$escmode = 0;
print OUT "1";
$typeetab = "anything";
print OUT "2";
my $a=omicoldapcnx->new($udat{adrldap},$udat{rne},$typeetab);
print OUT "3";
if ($a) {
if ($a->connect) {
print OUT "4";
%x = $a->getuser();
print OUT "5";
}
else {
print OUT "Connect error: ".$a->{_lasterror}."<br />";
}
}
else {
print OUT "New error: ".$a->{_lasterror}."<br />";
}
-]
- Cat is
[$ if 1 $]
Alive
[$ else $]
Dead
[$ endif $]
I get "1234- Cat is Alive Dead"
So what I "understand" (so to say) :
- embperl works normally until "%x = $a->getuser();"
- embperl does not find the "getuser" function (it's been renamed)
- embperl "gives up", does not finish the [- ... -] block
- embperl treats all subsequent [$ ... $] blocks as comments and prints
everything inbetween.
There is *no* error in /var/log/apache2/error.log
Lots of (unusable by me) stuff in EMBPERL_LOG depending on EMBPERL_DEBUG value.
A few more informations to help debugging :
- Module Apache2::Reload activated and working (checked with debug mode that my
package is recompiled)
- apache2-mpm-prefork 2.2.16-6+squeeze4
- libembperl-perl 2.3.0-1
- Running on Debian 6.0.4
- Linux miaou 2.6.32-5-686 #1 SMP Mon Jan 16 16:04:25 UTC 2012 i686 GNU/Linux
I will stop trying to work with objects because I have no time/knowledge to go
deeper.
I keep this code if someone (Gerald ?) wants to dig.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]