#!/pro/bin/perl

use strict;
use warnings;
use Time::HiRes qw(gettimeofday tv_interval);

my $x = 10;
for (my $d = 0; $d < 20 && $x < 10000; ) {
    open my $fh, ">", "p.csv";
    say $fh q{hello,","," ",world,"!"} for 1..$x;
    close $fh;

    my $t = [ gettimeofday ];
    system "perl5.12.5 csv-pegex.pl < p.csv >/dev/null";
    $d = tv_interval ($t, [ gettimeofday ]);
    printf "%5d %6d %6.3f %9.2f recs/sec\n", $x, -s "p.csv", $d, $x / $d;
    unlink "p.csv";
    $x = int ($x * 1.25);
    }
