1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
#!/usr/bin/env perl
use FindBin;
use lib "$FindBin::Bin/../lib";
use Catmandu::Sane;
use Catmandu::Store::AlephX;
use Data::Dumper;
use open qw(:std :utf8);
use Time::HiRes qw(gettimeofday tv_interval);
sub verbose {
state $count = 0;
state $start = [gettimeofday];
++$count;
my $speed = $count / tv_interval($start);
say STDERR sprintf " (doc %d %f)" ,$count,$speed if ($count % 10 == 0);
}
my $bag = Catmandu::Store::AlephX->new(url => "http://borges1.ugent.be/X",username=> "test",password => "test")->bag();
$bag->tap(\&verbose)->each(sub{
print Dumper(shift);
});
|