File: cpants.pl

package info (click to toggle)
liborlite-mirror-perl 1.24-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 312 kB
  • sloc: perl: 2,347; sql: 8; makefile: 2
file content (23 lines) | stat: -rw-r--r-- 596 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/perl

# Allow people debugging to walk down into the generation code
BEGIN {
	$DB::single = 1;
}

# Create an ORM model on the CPANTS database.
# Mirror the data and generate the classes.
use ORLite::Mirror {
	url           => 'http://cpants.perl.org/static/cpants_all.db.gz',
	package       => 'CPANTS',
	show_progress => 1,
	env_proxy     => 1,
};

# Run some queries on the data

my $count = CPANTS::Author->count;
print "CPANTS currently tracks $count authors\n";

my $authors = CPANTS::Author->select('where pauseid = ?', 'ADAMK');
print "ADAMK is " . $authors->[0]->name . "\n";