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." #### STDIN = console input; STDOUT = console display; system("stuff"); STDOUT = back to the redirected version;