I'm using perl modules in php via perl interpreter. I don't no how to include modules. I tried the following code,
Expand|Select|Wrap|Line Numbers
- <?php
- echo "hello";
- $perl=new Perl();
- $perl->eval('
- package Kernel::System::CustomerUser;
- use Kernel::Config;
- use Kernel::System::Encode;
- use Kernel::System::Log;
- use Kernel::System::Main;
- use Kernel::System::DB;
- use Kernel::System::CustomerUser;
- my $ConfigObject = Kernel::Config->new();
- my $EncodeObject = Kernel::System::Encode->new(
- ConfigObject => $ConfigObject,
- );
- my $LogObject = Kernel::System::Log->new(
- ConfigObject => $ConfigObject,
- EncodeObject => $EncodeObject,
- );
- my $MainObject = Kernel::System::Main->new(
- ConfigObject => $ConfigObject,
- EncodeObject => $EncodeObject,
- LogObject => $LogObject,
- );
- my $DBObject = Kernel::System::DB->new(
- ConfigObject => $ConfigObject,
- EncodeObject => $EncodeObject,
- LogObject => $LogObject,
- MainObject => $MainObject,
- );
- my $CustomerUserObject = Kernel::System::CustomerUser->new(
- ConfigObject => $ConfigObject,
- LogObject => $LogObject,
- DBObject => $DBObject,
- MainObject => $MainObject,
- EncodeObject => $EncodeObject,
- );
- my %List = $CustomerUserObject->CustomerSourceList();
- 1;
- '
- );
- //print $@->getErrorMessage();
- $p=new Perl("CustomerUser");
- var_dump($p);
- print "hello";
- //$p1=new Perl("CustomerUser", '1');
- //var_dump($p1);
- ?>
but got this error,
PerlException: [perl] eval error: Can't locate Kernel/Config.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .) at (eval 1) line 4. BEGIN failed--compilation aborted (in cleanup) Can't locate Kernel/Config.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .) at (eval 1) line 4. BEGIN failed--compilation aborted at (eval 1) line 4. in /var/www/mohan/adduseraction.php on line 44
Call Stack
# Time Memory Function Location
1 0.0002 56816 {main}( ) ../adduseraction.php:0
2 0.0002 58576 Perl->eval( ) ../adduseraction.php:44