Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: performance of File Parsing

by roboticus (Chancellor)
on Jul 07, 2011 at 10:55 UTC ( [id://913159]=note: print w/replies, xml ) Need Help??

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
    .....
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://913159]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2024-04-25 05:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found