rgaddi has asked for the wisdom of the Perl Monks concerning the following question:
Any thoughts on what I'm doing wrong?# Create a temporary file to hold the input. my ($fh, $filename) = tempfile(); # And stream everything into it. my $linecount = 0; while (<>) { $fh->print($_); $linecount++; } print STDERR "Wrote $linecount lines to $filename.\n"; # Now pass the input off to aspell for processing my $obj; my $appname = "C:\\Program Files\\Aspell\\bin\\aspell.exe"; my $cmdline = "--check $filename"; my $iflags = 0; my $cflags = NORMAL_PRIORITY_CLASS + CREATE_NEW_CONSOLE; my $curdir = "."; Win32::Process::Create( $obj, $appname, $cmdline, $iflags, $cflags, $curdir) or die "Couldn't shell to aspell.\n"; $obj->Wait(INFINITE); # Return the tempfile on standard output seek($fh, 0, 0); while (<$fh>) { print }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Shelling a new process with console I/O in Windows
by bellaire (Hermit) on Mar 10, 2009 at 18:04 UTC | |
|
Re: Shelling a new process with console I/O in Windows
by Bloodnok (Vicar) on Mar 10, 2009 at 18:08 UTC | |
|
Re: Shelling a new process with console I/O in Windows
by admiral_grinder (Pilgrim) on Mar 10, 2009 at 18:46 UTC | |
|
Re: Shelling a new process with console I/O in Windows
by Anonymous Monk on Mar 10, 2009 at 21:08 UTC | |
by BrowserUk (Patriarch) on Mar 11, 2009 at 00:33 UTC | |
|
Re: Shelling a new process with console I/O in Windows
by furry_marmot (Pilgrim) on Mar 11, 2009 at 19:00 UTC | |
by rgaddi (Novice) on Mar 11, 2009 at 22:21 UTC | |
by wol (Hermit) on Mar 13, 2009 at 14:25 UTC | |
by furry_marmot (Pilgrim) on Mar 19, 2009 at 20:45 UTC |