in reply to command line problem w/ perl2exe...

Perhaps you need to append a newline to this?
print PIPE "$key\n";