Source

AURLite / find.pl

Full commit
#!/usr/bin/env perl

use warnings;
use strict;

use Time::HiRes qw(time);
use JSON;

use lib 'lib';
use AURLite;
use AURLite::Query;

my $dbh = connect_db( 'aurlite.db' );
my $q   = AURLite::Query->new( $dbh );

for my $name ( @ARGV ) {
    my $start = time;
    my $pkg_ref = $q->pkg_by_name( $name ) or next;
    print to_json( $pkg_ref, { 'pretty' => 1 } ), "\n";
    printf "%0.3f elapsed seconds.\n", (time - $start);
}