This sounds like a problem I'm having with both the Lingua::ISpell and Text::ISpell modules. Every script I write with them just hangs when an attempt is made to read from the spawned process's output pipe. Both modules use an open2 call from an _init() function prior to calling spellcheck(). Here's what they look like:
sub _init {
...
$Lingua::Ispell::pid = open2(
*Reader,
*Writer,
$Lingua::Ispell::path,
'-a', '-S',
@options,
);
...
}
sub spellcheck {
_init() or return(); # caller should really catch the exception fro
+m a failed open2.
my $line = shift;
local $/ = "\n"; local $\ = '';
chomp $line;
$line =~ s/\r//g; # kill the hate
$line =~ /\n/ and croak "newlines not allowed in arguments to Lingua
+::Ispell::spellcheck!";
print Writer "^$line\n";
my @commentary;
local $_;
while ( <Reader> ) {
chomp;
last unless $_ gt '';
push @commentary, $_;
}
From a debugger, I see that it hangs at the line:
while ( <Reader> ) {
By the by, I'm trying to write a litte script to check fields in a database for spelling errors and write out a log of misspelled words.
Any ideas on what I'm doing wrong?
( I can't even run the example code for these modules without hanging. Oh, I'm on a Windows machine and cannot use a real operating system.)
|