Diff for /db/prgsrc/chgkfiles.pm between versions 1.1 and 1.4

version 1.1, 2001/10/31 03:00:07 version 1.4, 2001/11/19 01:10:39
Line 1 Line 1
 package chgkfiles;  #!/usr/bin/perl
 use DBI;  
 use Exporter;  =head1 NAME
 use vars qw(@ISA @EXPORT);  
 @ISA=qw(Exporter);  chgkfiles.pm
   
 @EXPORT = qw(&input_files &output_files &mywrite &auto_message  =head1 SYNOPSIS
             &myprint &config_error &getstring);    :(
   
   =head1 DESCRIPTION
 BEGIN {do "chgk.cnf"};  
     :(
 my %prt;  
   =head1 AUTHOR
 sub auto_message  
 {  òÏÍÁÎ óÅÍÉÚÁÒÏ×
   my $time=localtime;  
   my $f=$_[0];  =cut
   
   print $f "# This file is automatically generated at $time by $_[1]\n";  package chgkfiles;
 }  use DBI;
   use Exporter;
 sub mywrite  use vars qw(@ISA @EXPORT);
 {  @ISA=qw(Exporter);
   (my $file, %prt)=@_;  
   write $file;  @EXPORT = qw(&input_files &output_files &mywrite &auto_message 
 }              &myprint &config_error &getstring);
   
 sub myprint  
 {  BEGIN {do "chgk.cnf"};
   (my $file, @prt)=@_;  
   print $file @prt;  my %prt;
 }  
   sub auto_message
 sub setcount  {
 {    my $time=localtime;
   $c=shift    my $f=$_[0];
 }  
     print $f "# This file is automatically generated at $time by $_[1]\n";
 sub setword  }
 {  
   $word=shift  sub mywrite
 }  {
     (my $file, %prt)=@_;
     write $file;
 sub getstring #áåð¸ò ïåðâóþ  }
 {  
   sub myprint
    if ($#_>=1) { $a=$_[1]; $pattern=qr/$_[0]/}  {
    else {$a=$_[0]; $pattern=qr/\s+/};    (my $file, @prt)=@_;
    do    print $file @prt;
    {    }
      $b=<$a>;  
      $b =~ s/^\s+//g;  sub setcount
      $b =~ s/\s+$//g;  {
      $b =~ s/\#.*$//g;    $c=shift
    }  }
    until (($b ne '')||eof($a));  
   sub setword
   {
   $b ? split(/$pattern/, $b):undef;    $word=shift
 }  }
   
 sub config_error()  
 {  sub getstring #áåð¸ò ïåðâóþ
   "Can not open $_[0] file ${$_[0]}. Check your config.pl";  {
 }  
      if ($#_>=1) { $a=$_[1]; $pattern=qr/$_[0]/}
      else {$a=$_[0]; $pattern=qr/\s+/};
      do
 sub input_files     {   
 {       $b=<$a>;
     foreach $file (@_)       $b =~ s/^\s+//g;
     {       $b =~ s/\s+$//g;
           my $f=lc $file;       $b =~ s/\#.*$//g;
           open($file, "<$$f") or die "Can not open $file file $$f. Check your chgk.cnf\n";     }
     }     until (($b ne '')||eof($a));
 }  
   
 sub output_files    $b ? split(/$pattern/, $b):undef;
 {  }
     foreach $file (@_)  
     {  sub config_error()
           my $f=lc $file;  {
           open($file, ">$$f") or die "Can not open $file file $$f. Check your chgk.cnf\n";    "Can not open $_[0] file ${$_[0]}. Check your config.pl";
     }  }
 }  
   
 format WORDLIST =  
 @####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<  sub input_files
 $prt{c}, $prt{word}  {
 .      foreach $file (@_) 
       {
                    my $f=lc $file;
 format DWORDLIST =            open($file, "<$$f") or die "Can not open $file file $$f. Check your chgk.cnf\n";
 @####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<      }
 $prt{c}, $prt{word}  }
 .  
   sub output_files
 format VWORDLIST =  {
 @####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<      foreach $file (@_) 
 $prt{c}, $prt{word}      {
 .            my $f=lc $file;
             open($file, ">$$f") or die "Can not open $file file $$f. Check your chgk.cnf\n";
       }
 format EWORDLIST =  }
 @####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<  
 $prt{c}, $prt{word}  format WORDLIST =
 .  @####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
   $prt{c}, $prt{word}
 format KWORDLIST =  .
 @####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<  
 $prt{c}, $prt{word}          
 .  format DWORDLIST =
   @####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
   $prt{c}, $prt{word}
   .
 format TABLE =  
 @<<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<  format VWORDLIST =
 $prt{word}, $prt{nf}, $prt{flag}  @####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 .  $prt{c}, $prt{word}
   .
 format NEWTABLE =  
 @<<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<  
 $prt{word}, $prt{nf}  format EWORDLIST =
 .  @####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
   $prt{c}, $prt{word}
   .
   
 format NF =  format KWORDLIST =
 @####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<  @####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 $prt{c}, $prt{word}, $prt{flag}  $prt{c}, $prt{word}
 .  .
   
 format NEWNF =  
 @####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<  
 $prt{c}, $prt{word}  format TABLE =
 .  @<<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
   $prt{word}, $prt{nf}, $prt{flag}
   .
 format ERRORS =  
 @####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<  format NEWTABLE =
 $prt{c}, $prt{word}  @<<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 .  $prt{word}, $prt{nf}
   .
 format NEWERRORS =  
 @####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<  
 $prt{c}, $prt{word}  
 .  format NF =
   @####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 format VERSIONS =  $prt{c}, $prt{word}, $prt{flag}
 @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<  .
 $prt{c}, $prt{word}, $prt{k}  
 .  format NEWNF =
   @####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 format EQUALS =  $prt{c}, $prt{word}
 @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<  .
 $prt{first}, $prt{second}  
 .  
   format ERRORS =
 format IN2OUT =  @####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 @<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<  $prt{c}, $prt{word}
 $prt{in}, $prt{out}  .
 .  
   format NEWERRORS =
 format CTABLE =  @####### @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<  $prt{c}, $prt{word}
 $prt{word}, $prt{number}  .
 .  
   format VERSIONS =
 format CNF =  @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<  $prt{c}, $prt{word}, $prt{k}
 $prt{kvo}  .
 .  
   format EQUALS =
 format ALIKE  =  @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< | ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<  $prt{first}, $prt{second}
 $prt{first}, $prt{second}  .
 ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< | ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<~~  
 $prt{first}, $prt{second}  format IN2OUT =
 .  @<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
   $prt{in}, $prt{out}
   .
 1;  
   format CTABLE =
 __END__  @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
   $prt{word}, $prt{number}
   .
   
   format CNF =
   @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
   $prt{kvo}
   .
   
   format ALIKE  =
   ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< | ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
   $prt{first}, $prt{second}
   ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< | ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<~~
   $prt{first}, $prt{second}
   .
   
   
   1;
   
   __END__

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


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