Hi,

I have the following subroutine in a package that's called by an embperl
page via mod_perl:

sub MP3Check {
   my ($self,$params) = @_;
   use IPC::Open3;
   my ($pid,%values);

   $SIG{ALRM} = sub {
      my $kill = "kill -9 $pid";
      system($kill);
      $values{'CHECK_PROBLEM'} = 1;
      return;
   };

   my $command = qq!$self->{MP3Check} -v "$params->{file}"!;
   alarm(5);
   $pid = open3(*IN, *OUT, *ERR, $command);
   waitpid $pid, 0;
   alarm(0);
   close(IN);
   my @outlines = <OUT>;
   for ( @outlines ) {
      $values{$1} = $2 if /^([A-Z_]+)\s+(.*)$/;
   }
   return \%values;
}

I'm getting the error message:

[16307]ERR: 24: Error in Perl code: Can't locate object method "OPEN" via
package "Apache::RequestRec" at /usr/lib/perl5/5.8.0/IPC/Open3.pm line 136.

I read a post that mentions:

OPEN was added after 1.99_08. Please build the cvs version of mod_perl 2.0:
http://perl.apache.org/download/source.html#2_0_Development_Source_Distribut
ion

I then found this info on building an RPM from CVS:

http://www.gossamer-threads.com/archive/mod_perl_C1/modperl_F7/mod_perl-1.99
_09_for_Redhat_9_P68324/

I got the spec file and built a new rpm:

mod_perl-2.0_cvs-1.99.10

However, I still get the same error...

Can any one give me any ideas on how to fix this?

I also read a post about IPC::Open... I looked at the synopsis and it looks
rather complicated. Is this definately a better way to go?

Any help would be greatly appreciated.

Cameron




Reply via email to