#!/usr/bin/perl # use strict; use DBI; my ($user, $pass) = split(/\t/, `cat ~/.pass/mysql`); my $dbh = DBI->connect("DBI:mysql:livejournal", $user, $pass); my $sth; my ($year, $month) = (1999, 1); my ($last, $count); do { $last = $count; $count = $dbh->selectrow_array("SELECT COUNT(*) FROM userusage WHERE timecreate < ?", undef, sprintf("%04d-%02d-01", $year, $month)); printf "%02d%02d %d\n", $month, $year % 100, $count; $month += 3; if ($month > 12) { $month = 1; $year++; } } while (1);