#!/usr/bin/perl
#
use strict;
use IO::File;
use IO::Poll qw(POLLRDNORM POLLWRNORM POLLIN POLLHUP);

local $| = 1;
my $count;
my $nfh = IO::File->new('/dev/null', 'r');
my $poll = IO::Poll->new();
$poll->mask($nfh => POLLIN);
while (1) {
    $poll->poll(500);
    my $fh = IO::File->new('/proc/bus/usb/devices', 'r') || die $!;
    my @stat = stat $fh;
    print ".";
    if ($count++ > 60) {
	print "\n";
	$count = 0;
    }
    while (<$fh>) {
	# nothing
	chomp;
    }
}
