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: \
In reply to Re: Reading the Putty Window Title (or how can I read from STDIN with out having to hit the [Enter] key?
by almut
in thread Reading the Putty Window Title (or how can I read from STDIN with out having to hit the [Enter] key?
by NateTut
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |