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

Uncaught exception 'PerlException'

P: 12
Hi,
I'm very new to perl. I tried to use the perl module in php script, but im getting error

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. $perl = new Perl();
  3. $perl->eval("BEGIN {unshift( @INC, '/opt/otrs');}");
  4. $perl->eval('use Kernel::System::Email qw(new Send ConfigObject LogObject DBObject TimeObject MainObject EncodeObject _MessageIDCreate Log Get); ');
  5. $ar=array(From        => 'me@example.com',
  6.         To          => 'friend@example.com',
  7.         Subject     => 'Some words!',
  8.         Charset     => 'iso-8859-15',
  9.         MimeType    => 'text/plain', # "text/plain" or "text/html"
  10.         Body        => 'Some nice text',
  11.         InReplyTo   => '<somemessageid-2@example.com>',
  12.         References  => '<somemessageid-1@example.com> <somemessageid-2@example.com>',
  13.         Loop        => 1, # not required, removes smtp from
  14.         Attachment  => '',
  15.         Sign         => '',
  16.         Crypt         => '',
  17.     Priority    => '',);
  18. $ar1=array(Priority => 'error', Message => "Need $_!" );
  19. var_dump($perl->Send($ar1));
  20. var_dump($perl->eval('_MessageIDCreate->{ConfigObject}->Get();'));
  21. ?>
  22.  

But Im getting this error

Fatal error: Uncaught exception 'PerlException' with message '[perl] call error: (in cleanup) Can't call method "Log" on an undefined value at /opt/otrs/Kernel/System/Email.pm line 178. ' in /var/www/mohan/t8.php:19 Stack trace: #0 /var/www/mohan/t8.php(19): Perl->Send(Array) #1 {main} thrown in /var/www/mohan/t8.php on line 19

And the module is working fine It has no problem. Please help me in solving out this issue........
May 31 '10 #1
Share this Question
Share on Google+
1 Reply


Expert
P: 80
Can you try running Perl code without PHP as stndalone program?
Jun 6 '10 #2

Post your reply

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