5 use FS::UID qw(adminsuidsetup dbh);
6 use FS::Cron::bill qw(bill_where);
10 #&untaint_argv; #what it sounds like (eww)
12 getopts("p:a:d:vl:sy:nmrk", \%opt);
16 #we're at now now (and later).
17 $opt{'time'} = $opt{'d'} ? str2time($opt{'d'}) : $^T;
18 $opt{'time'} += $opt{'y'} * 86400 if $opt{'y'};
20 $opt{'invoice_time'} = $opt{'n'} ? $^T : $opt{'time'};
23 my $sql = 'EXPLAIN SELECT custnum FROM cust_main WHERE '. bill_where(%opt);
25 my $sth = dbh->prepare($sql) or die dbh->errstr;
27 $sth->execute or die $sth->errstr;
29 while ( my $row = $sth->fetchrow_arrayref ) {
31 print join(' / ', @$row ). "\n";