version 1.32, 2003/01/09 19:48:44
|
version 1.35, 2003/02/24 13:59:27
|
Line 35 Dmitry Rubinstein
|
Line 35 Dmitry Rubinstein
|
use vars qw($opt_i); |
use vars qw($opt_i); |
|
|
use Getopt::Std; |
use Getopt::Std; |
|
my $unsortedname="../dump/unsorted"; |
getopts('i'); |
getopts('i'); |
#open STDERR, ">errors"; |
#open STDERR, ">errors"; |
my $Interactive=$opt_i || 0; |
my $Interactive=$opt_i || 0; |
Line 89 sub getField {
|
Line 90 sub getField {
|
$value =~ s/-(.*)-/-$month-/; |
$value =~ s/-(.*)-/-$month-/; |
$value =~ s/-00*$/-01/; |
$value =~ s/-00*$/-01/; |
} |
} |
|
if ($key eq 'Автор') {$value=~s/\.$//;} |
$value = $dbh->quote($value); |
$value = $dbh->quote($value); |
return ($key, $value); |
return ($key, $value); |
} |
} |
Line 146 sub SelectGroup {
|
Line 148 sub SelectGroup {
|
$ParentId = 9999; |
$ParentId = 9999; |
my $tempsource=$source; |
my $tempsource=$source; |
my $temptname=$TourName; |
my $temptname=$TourName; |
$tempsource=~s/^\'(.*)\'$/$1; |
$tempsource=~s/^\'(.*)\'$/$1/; |
$temptname=~s/^\'(.*)\'$/$1; |
$temptname=~s/^\'(.*)\'$/$1/; |
print UNSORTED "$tempsource".((12 -length($source))x' ')."\t$temptn\n"; |
print UNSORTED "$tempsource".((12 -length($source))x' ')."\t$temptname\n"; |
$isunsorted=1; |
$isunsorted=1; |
$sth = $dbh->prepare("INSERT INTO Tournaments |
$sth = $dbh->prepare("INSERT INTO Tournaments |
(Title, Type, ParentId, FileName) |
(Title, Type, ParentId, FileName) |
Line 273 MAIN:
|
Line 275 MAIN:
|
my($dbh) = DBI->connect("DBI:mysql:chgk", "piataev", "") |
my($dbh) = DBI->connect("DBI:mysql:chgk", "piataev", "") |
or die "Can't connect to DB chgk\n"; |
or die "Can't connect to DB chgk\n"; |
my @sources; |
my @sources; |
open UNSORTED, ">$DUMPDIR/unsorted"; |
open UNSORTED, ">$unsortedname"; |
while ($source = shift) { |
while ($source = shift) { |
push @sources,glob($source); |
push @sources,glob($source); |
} |
} |
Line 410 MAIN:
|
Line 412 MAIN:
|
print STDERR "Всего вопросов: $all_qnum \n"; |
print STDERR "Всего вопросов: $all_qnum \n"; |
} |
} |
close UNSORTED; |
close UNSORTED; |
unlink "unsorted" unless $isunsorted; |
unlink $unsortedname unless $isunsorted; |
$dbh->disconnect; |
$dbh->disconnect; |
} |
} |