I am trying to execute a binary using the following command :
system("update");
After executing "update" command, the system prompts the following :
"Press ENTER to exit:"
How do I implement the above in my perl script?
I am trying to execute a binary using the following command :
system("update");
After executing "update" command, the system prompts the following :
"Press ENTER to exit:"
How do I implement the above in my perl script?
use strict;
use warnings;
print "Press ENTER to exit:";
<STDIN>;
$| to something other than undef or 0. Otherwise, the output gets buffered, and depending upon the system, it might not do quite what you want.$| set to Null to read from a socket, where protocol packets were null-separated. Afterwards, trying to read from <STDIN> like above would keep reading until I either entered the null character (Ctrl+shift+@) or EOF (ctrl+D) - pressing enter had no effect. Setting #| to "\n" solved the problem.