D'oh! This is true, problem is lacking in problem. The problem is that I'm not getting a new console window for the shelled program. Everything's staying in the original console (which I care less about), and more to the point not turning STDIN back over to the keyboard, which makes interactive programs like aspell much harder to use. This means that "perl -w aspell_filter.pl README.TXT" works just fine, but "type README.TXT | perl -w aspell_filter.pl" doesn't. The latter is, unfortunately, the whole reason for putting this together in the first place. I've taken the variable of aspell out of the mix by replacing the call with CMD.EXE for now, just to see what's going on. Here's the entire program again, with the changes, and all of the initial 'use's.
use strict; use IO::File; use File::Temp qw(tempfile); use Win32::Process; use Win32; # 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:\\windows\\system32\\cmd.exe"; my $cmdline = "/K dir"; 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 } print "Check complete."
Sorry for the initial screwup. Anyone got any thoughts? I'm not tied to the idea of a second console, or using Win32::Process directly, I'm just looking for the moral equivalent of:
STDIN = console input; STDOUT = console display; system("stuff"); STDOUT = back to the redirected version;

In reply to Re: Shelling a new process with console I/O in Windows by Anonymous Monk
in thread Shelling a new process with console I/O in Windows by rgaddi

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.