in reply to Shelling a new process with console I/O in Windows

Dude,

This is some weird stuff. It looks like you're spell-checking a tempfile. Doesn't aspell make a backup after it's done?

Anyway, if you change " + CREATE_NEW_CONSOLE" to " | CREATE_NEW_CONSOLE", it should work fine.

BTW, if the original window is supposed to wait for aspell to finish anyway, why not just do this:
system('C:/Program Files/Aspell/bin/aspell.exe', '--check', "$filename +");

Replies are listed 'Best First'.
Re^2: Shelling a new process with console I/O in Windows
by rgaddi (Novice) on Mar 11, 2009 at 22:21 UTC
    Yep, that was it. The entire point was to be able to wrap the interactive version of aspell in a pipeline, i.e.
    head filename | perl aspell_filter.pl | sort
    or some such nonsense. The reason behind all of this is that the email client I'm trying to use these days for various reasons, Claws Mail, doesn't have a built-in spell checker on the Windows port. It does, however, have the ability to pipe all of the text of the email being worked on to the standard input of another program, then replace that email text with whatever comes out of the standard output. Hence the need for a wrapper to allow me to take in STDIN, work with it via console+keyboard, and pipe the results back out STDOUT. The hope was to be able to throw something together quick and dirty in 20 lines and be done with it. The reality has been anything but, and I think I'm on the verge of abandoning the project. furry_marmot's tip solved the immediate problem; I can now embed the program in a pipeline and it pops up a new console and works beautifully. But it's still not working from Claws, nor is
    print "Results are:\n"; while (<>) { print; }
    Leading me to believe that Claws's pipeline features are broken under Windows as well, thus defeating the point of the project. Still, thanks for the help. I'm sure I'll wind up needing that trick again at some point.
Re^2: Shelling a new process with console I/O in Windows
by wol (Hermit) on Mar 13, 2009 at 14:25 UTC
    change " + CREATE_NEW_CONSOLE" to " | CREATE_NEW_CONSOLE", it should work fine.
    That really shoudn't make any difference. The result would only be different if there were some bits in common between the two constants being added/orred.

    However, there couldn't be any bits in common, because otherwise the function being called couldn't work out a specific meaning for a bit being set.

    That aside, good call on using system() :-)

    --
    use JAPH;
    print JAPH::asString();

      It shouldn't make a difference, but it does. The first way doesn't work. Windows documentation says to use the pipe character, so I just always do.

      Anyway, thanks!