in reply to open2 with windows diskpart

use IO::Handle qw( ); IN->autoflush(1);

Wouldn't you need a newline too?

print IN "list disk\n";