http://qs321.pair.com?node_id=212814


in reply to Input/Output through the Keyboard

Others have correctly answered this question for normal, command line Perl scripts, referring to STDIN. However, for completeness, there is another case: that of GUI programming. How does one get access to the keyboard from a Tk application?

Over and above text fields, where the default bindings allow cursor based editing, you may find that you need to add bindings in order to trap certain keystrokes and key combinations.

In the case of a GUI application, STDOUT (and STDERR) go to the command window, if the application has been invoked with one. Just for the record, for CGI applications, STDIN is used to read POST data, STDOUT is used to send HTTP data (normally HTML, but could be graphical), and STDERR writes to the webserver's error log file.