in reply to Reading the Putty Window Title (or how can I read from STDIN with out having to hit the [Enter] key?

The problem is that input is normally line buffered, but you could use Term::ReadKey.  Something like

#!/usr/bin/perl use strict; use warnings; use Term::ReadKey; $| = 1; print "\e[21t"; ReadMode 3; my $key; while (not defined ($key = ReadKey(-1))) { } while (defined ($key = ReadKey(-1))) { print "key: $key\n"; } ReadMode 0; __END__ key: ] key: L key: T key: e key: r key: m key: i key: n key: a key: l key:  key: \
  • Comment on Re: Reading the Putty Window Title (or how can I read from STDIN with out having to hit the [Enter] key?
  • Download Code

Replies are listed 'Best First'.
Re^2: Reading the Putty Window Title (or how can I read from STDIN with out having to hit the [Enter] key?
by NateTut (Deacon) on Sep 04, 2009 at 18:52 UTC
    Excellent. Thank you!