#! perl -slw use strict; use Time::HiRes qw[ time ]; binmode STDIN; my $buf = ''; while( 1 ) { sysread( STDIN, $buf, 1 ); my $end = time() + 7; sleep 0.1 while time() < $end; sysread( STDIN, $buf, 1024, length( $buf ) ); printf "Got: '%f'\n", unpack 'd', $buf; }