Diff for /db/prgsrc/counter7.pl between versions 1.3 and 1.4

version 1.3, 2001/12/31 18:22:32 version 1.4, 2002/01/03 18:03:53
Line 1 Line 1
 #!/usr/bin/perl  #!/usr/bin/perl
 $wait=3;  $wait=3;
 $cfile  = 'counts/count7.txt';  
 open STDERR, ">errors";  
 $lockdir="counts/";  
 $l = lc $ENV{'DOCUMENT_NAME'};  
 $header="Content-Type: text/html\n\n";  $header="Content-Type: text/html\n\n";
 print $header;  print $header;
 &lockfile && (print '?? раз', exit);  
   
 open(F, $cfile);  $cfile  = 'count7';
   $cfiledir = '/home/piataev/public_html/cgi-bin/counts7';
   chdir $cfiledir;
   
   open STDERR, ">errors" or print "Oppa";
   $lockdir="";
   $lockdir=$cfiledir;
   $l = lc $ENV{'DOCUMENT_NAME'};
   if ($a=&lockfile)
     { print "$a ?? раз"; 
       exit ;
     }
   
   open(F, "$cfile");
 @DATA = <F>;  @DATA = <F>;
 close(F);  close(F);
 foreach (@DATA) {  foreach (@DATA) {
Line 18  foreach (@DATA) { Line 26  foreach (@DATA) {
   {    {
     $c++;      $c++;
     $_ = "$c - $bl\n";      $_ = "$c - $bl\n";
     $tmp = "cfile$$.tmp";      $tmp = "$cfile$$.tmp";
     open(F, ">$tmp");      open(F, ">$tmp");
     print F @DATA;      print F @DATA;
     close(F);      close(F);
Line 38  print "первый раз"; Line 46  print "первый раз";
   
 sub lockfile  sub lockfile
 {    {  
    $tmp="$lockdir$cfile$$.tmp";     $tmp="$cfile$$.tmp";
    $lock="$lockdir$cfile.loc";     $lock="$cfile.loc";
    open F,">$tmp" or return 1;     open F,">$tmp" or (print $@,return 1);
    print F $$;     print F $$;
    close F;     close F;
    if (-e $lock) {     if (-e $lock) {

Removed from v.1.3  
changed lines
  Added in v.1.4


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>