rkg has asked for the wisdom of the Perl Monks concerning the following question:
package Word::Spell; use strict; use warnings; use lib qw(c:\ blah blah blah blah); use base qw(Exporter); our @EXPORT_OK = qw(spell); use IPC::Open3; my ($pid, $wph, $rph, $eph); BEGIN { my $cmd = 'c:/apps/aspell/bin/aspell'; my $args = '-a'; #-pipe --ignore-case --sug-mode=normal'; $pid = open3($wph, $rph, $eph,$cmd, $args); # eat and confirm the id line my $idline = <$rph>; die "bad idline: $idline" unless $idline =~ /Aspell 0.50.3/; } sub spell { my ($word) = @_; die "word '$word' has spaces" if $word =~ /\s/; die "word '$word' has numbers" if $word =~ /\d/; die "word '$word' has odd chars" if $word =~ /[^A-Z-]/i; print $wph "^$word\n"; my $result = <$rph>; return $result; } END { kill 9, $pid; } 1;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Windows & IPC -- request for comments
by BrowserUk (Patriarch) on Aug 06, 2003 at 23:31 UTC | |
|
Re: Windows & IPC -- request for comments
by rkg (Hermit) on Aug 06, 2003 at 22:32 UTC | |
|
Re: Windows & IPC -- request for comments
by rkg (Hermit) on Aug 06, 2003 at 22:56 UTC |