in reply to write to cmd and save output

Dunno if this works on win32, but assuming you can do you postprocessing AFTER the command is run:
open CMD,"|prog.exe >out.log" or die "$!"; print CMD "stuff"; close CMD; open LOG,"<out.log" or die "$!" while (<LOG>) { process($_); } close LOG;
HTH, Joost
-- #!/usr/bin/perl -w use strict;$;= ";Jtunsitr pa;ngo;t1h\$e;r. )p.e(r;ls ;h;a;c.k^e;rs ";$_=$;;do{$..=chop}while(chop);$_=$;;eval$.;