I am not sure if Open2 automagically autoflushes the IO so you may want to turn on autoflushing and try again to see if that helps. You should also turn on warnings with 'use warnings' and see if that gives any more information.

Don't know why other than not flushing the buffers this would work any different from the command line than CGI.

http://danconia.org

Miroslav Suchy wrote:
Greetings.
I have problem with following code. It read output from ispell using
IPC::Open2. When I run it from command line, then everything is ok. But
when I run it under Apache as cgi -- it do not read output from ispell.
Actually it read first line from ispell so IPC::Open2 is probably ok...
When it run well as script, there should be no problem with ispell...
WHERE is the problem?

#!/usr/bin/perl
use strict;
use IPC::Open2;
use CGI;

my $path = '/usr/bin/ispell';
my $pid = open2(
      *Reader,
      *Writer,
      $path,
      '-d', 'czech',
      '-a'
    );
my $q=new CGI;

print $q->header, $q->start_html;

my $hdr = scalar(<Reader>);
#ALWAYS return @(#) International Ispell Version 3.1.20 10/10/95,patch 1

print Writer "^lupou\n";
my $line=scalar(<Reader>);
  #script return '+ LUPA', that's ok
  #cgi return undef (realy undef, not '')

print $q->end_html;



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to