-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQuery_SBC.pl
More file actions
28 lines (26 loc) · 1.05 KB
/
Query_SBC.pl
File metadata and controls
28 lines (26 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/perl
use DBI;
$|=1;
my $db=DBI->connect("DBI:mysql:database=sbc;host=localhost","root","");
my $st=$db->prepare("
select * from dialogs,sbc,speakers where (line like '%fuck%'
or line like '%shit%'
and line not like '%dipshit%'
and line not like '%bullshit%'
or line like '%damn%'
and line not like '%damnation%'
and line not like '%damndest%') and speakers.speakerid=dialogs.speakerid
and sbc.sbcid=dialogs.sbcid
and speakers.gender='f' and sbc.speakers!='mix'
");
$st->execute();
my ($cnt,%speakers)=(0,{});
while (my $rs=$st->fetchrow_hashref()) {
next if ($speakers{$rs->{'speakerid'}});
print "$rs->{'line'}\n";
$speakers{$rs->{'speakerid'}}="DONE";
$cnt++;
}
$st->finish();
$db->disconnect();
print "\n$cnt result(s)\n\n";