my @array; my $i=0; my $Radio_string =""; # Need to launch RTLAMR and read the strings coming out. # Can pre-filter to just MY meter on the commandline with: # cd ~/go/bin # ./rtlamr -msgtype=scm+ --format=json -filterid=101419821, 101419999 +-unique=false # Launch the radio system("/home/jj/go/bin/rtlamr -msgtype=scm+ --format=json -filterid=1 +01419821,101419999 -unique=false"); # slurp the headers do { $Radio_string = $_; Print $i; Print $Radio_string; $i++; } until $i == 10; Print("\n-------End of headers.--------\n\n"); # now wait for and process usage reports #@array = json(system("/home/jj/go/bin/rtlamr -msgtype=scm+ --format=j +son -filterid=101419821,101419999 -unique=false")); $Radio_string = $_; Print $Radio_string; @array = json($Radio_string); Dump(@array); #### use IO::Handle; #for flush method my $rtlamr = "/home/jj/go/bin/rtlamr -msgtype=scm+ --format=json -filterid=1 +01419821,101419999 -unique=false"; open my $fh, '-|', $rtlamr or die "unable to start rtlamr program $!"; my $disk_file = "somepath"; open my $disk_fh, '>>', $disk_file or die "unable to open disk history file! $!"; while (<$fh>) # this is a "blocking" read of radio receiver { print $disk_fh $_; $disk_fh-> flush; # update disk file immediately } __END__ That's it. The analysis program of the disk file, "somepath" is a separate program.