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 from 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 ( ) { chomp; last unless $_ gt ''; push @commentary, $_; } #### while ( ) {