/[corp]/convert/veterina/fix_have_smpc.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /convert/veterina/fix_have_smpc.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations)
Tue May 8 10:43:53 2001 UTC (22 years, 10 months ago) by dpavlin
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +2 -1 lines
File MIME type: text/plain
paths for production

1 #!/usr/local/bin/perl
2
3 use DBI;
4 my $dbh = DBI->connect("DBI:Pg:dbname=corp","","") || die $DBI::errstr;
5 my $sth;
6
7 #my $dir="/home/dpavlin/private/corp/public_html/vet";
8 my $dir="/data/corp_html/vet";
9 opendir(DIR, $dir) || die "can't opendir $dir: $!";
10 #grep { /^\./ && -f "$dir/$_" && /^\d\d\d\d.htm/ }
11 while($file=readdir(DIR)) {
12 if ($file !~ /^\./ && -f "$dir/$file" && $file =~ /^\d\d\d\d\.htm/) {
13 $file=~s/\.html*//;
14 push @smpcs,$file
15 }
16 }
17 closedir(DIR);
18
19 $dbh->do("update vet_products set have_smpc=false");
20 $dbh->do("update vet_products set have_smpc=true where smpc in (".join(",",@smpcs).")");

  ViewVC Help
Powered by ViewVC 1.1.26