Hello, im very new to perl, modperl and apache but im doing a university project to use modperl to provide a connection to a localised Gnu Octave installation.

I have come against a problem when trying to run this simple test program:-

package Apache::OctavePrototype;

use FileHandle;
use IPC::Open2;
use Apache::Const -compile => ':common';
use Apache::Request;
use Apache::Process;
use Apache::Upload;

sub handler {

   my $r = Apache::Request->new(shift);
   my $octave_cmd = $r->param('octave_cmd') || 'No Command';
   my $output_text;
   $r->content_type('text/html');

        my $pid = open2( \*ReaderFH, \*WriterFH, "sh.exe -e 
/bin/start_octave.sh");

        my($read);
        for (1..11)
        {
                $read = <ReaderFH>;
                $output_text = $output_text.$read;
        }

               $r->print($output_text);

        return OK;
}

1;
__END__


I get an error generated in the apache error log file:-

C:/Perl/site/lib/Apache2/Apache/OctavePrototype.pm line 19\n
[Wed Feb 09 13:25:34 2005] [error] [client 127.0.0.1] open2: Can't close: No such file or directory at



Traced to the lines in the IPC:Open3 module :-

foreach $fd (@$fds) {
        $fd->{handle}->fdopen($fd->{tmp_copy}, $fd->{mode});
        $fd->{tmp_copy}->close or croak "Can't close: $!";
   }


Im using a perl/apache binary - Perl-5.8-win32-bin.exe downloaded form http://httpd.apache.org/ and windows xp.



Anyone with any help or ideas please let me know

thanks in advance




Reply via email to