#!/usr/bin/perl -w use strict; use Term::ReadKey; ReadMode (3); #try mode 4 also! while (1) { binmode('stdin'); my $buf; read('stdin', $buf, 1, 0); print ord $buf; }