open my $can_bus, "./receivetest |" or die "Couldn't read from CAN bus: $!"; my %last_value; while( <$can_bus>) { if( /^(........:...) (........) (.*)$/ ) my( $something, $id, $payload)= ($1,$2,$3); $last_value{ $id }= $payload; system('clear'); # clear screen # print the table for my $id (sort keys %last_value) { print "$id\t$last_value{ $id }\n"; }; } else { warn "Ignoring unknown line:"; warn $_; }; };