Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl 
    #    stream_write.pl - Slowly generate data
    ...
        sleep 5*rand; 
    }   
    close $OFH;
    
  2. or download this
    #!/usr/bin/perl
    #   stream_read.pl - Read, parse & print data as it's available
    ...
        my ($old_time, $cnt) = split /,\s*/, $line;
        print "$cur_time  data: $old_time, $cnt\n";
    }
    
  3. or download this
    $ perl stream_read.pl
    1310035999  data: 1, 1310035990
    ...
    1310036014  data: 13, 1310036008
    1310036014  data: 14, 1310036010
    .....