in reply to using IPC::Run

$in ="c:\n"; isn't doing what you think it is. Inside a doubly-quoted string, \n is interpreted as a newline character. I think you probably meant $in ="c:\\n";.

Unless I state otherwise, all my code runs with strict and warnings