By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,660 Members | 1,230 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,660 IT Pros & Developers. It's quick & easy.

PerlException: [perl] eval error

P: 12
Hi,
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
  1. <?php
  2. echo "hello";
  3. $perl=new Perl();
  4.  
  5. $perl->eval('
  6. package Kernel::System::CustomerUser;
  7.  
  8.         use Kernel::Config;
  9.         use Kernel::System::Encode;
  10.         use Kernel::System::Log;
  11.         use Kernel::System::Main;
  12.         use Kernel::System::DB;
  13.         use Kernel::System::CustomerUser;
  14.  
  15.         my $ConfigObject = Kernel::Config->new();
  16.         my $EncodeObject = Kernel::System::Encode->new(
  17.             ConfigObject => $ConfigObject,
  18.         );
  19.         my $LogObject = Kernel::System::Log->new(
  20.             ConfigObject => $ConfigObject,
  21.             EncodeObject => $EncodeObject,
  22.         );
  23.         my $MainObject = Kernel::System::Main->new(
  24.             ConfigObject => $ConfigObject,
  25.             EncodeObject => $EncodeObject,
  26.             LogObject    => $LogObject,
  27.         );
  28.         my $DBObject = Kernel::System::DB->new(
  29.             ConfigObject => $ConfigObject,
  30.             EncodeObject => $EncodeObject,
  31.             LogObject    => $LogObject,
  32.             MainObject   => $MainObject,
  33.         );
  34.         my $CustomerUserObject = Kernel::System::CustomerUser->new(
  35.             ConfigObject => $ConfigObject,
  36.             LogObject    => $LogObject,
  37.             DBObject     => $DBObject,
  38.             MainObject   => $MainObject,
  39.             EncodeObject => $EncodeObject,
  40.         );
  41.  my %List = $CustomerUserObject->CustomerSourceList();
  42. 1;
  43. '
  44. );
  45.  
  46. //print $@->getErrorMessage();  
  47.  
  48.  
  49. $p=new Perl("CustomerUser");
  50. var_dump($p);
  51. print "hello";
  52. //$p1=new Perl("CustomerUser", '1');
  53. //var_dump($p1);
  54. ?>

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
May 14 '10 #1
Share this Question
Share on Google+
1 Reply


Expert Mod 100+
P: 589
Kernel::Config is either not installed, or was not installed correctly.

Have you tried installing the module?
May 14 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.