Diff for /loncom/build/Attic/parse.pl between versions 1.1 and 1.3

version 1.1, 2000/12/05 15:30:47 version 1.3, 2000/12/07 20:42:13
Line 3 Line 3
 # Scott Harrison  # Scott Harrison
 # November 2000  # November 2000
   
 # read in loncapa tags and metagroup tags  # Read in loncapa tags and metagroup tags
   
   # -------------------------------------------- Read in command line arguments
 my ($file,$mode)=@ARGV;  my ($file,$mode)=@ARGV;
   
   # -------------------------------------------- Read in master data file
 open IN,"<$file";  open IN,"<$file";
 my @lines=<IN>;  my @lines=<IN>;
 close IN;  close IN;
   
 my $info=join('',@lines);  my $info=join('',@lines);
 my $info2=$info; # value to allow for meta data group retrieval  my $info2=$info; # value to allow for meta data group retrieval
   
 my %ihash; # big data storage object  my %ihash; # big data storage object
 while ($info=~/\<loncapa\s+(.*?)\>/isg) {  while ($info=~/\<loncapa\s+(.*?)\>/isg) {
     my $keystring=$1;      my $keystring=$1;
     my %hash=map {my ($key,$value)=split(/\=(?!")|\=(?=\s*"[^"]*"[^"]*$)/); $value=~s/^"//; $value=~s/"$//;(uc($key),$value);} split(/\s+(?=\w+\s*\=)/,$keystring);      my %hash=map {my ($key,$value)=split(/\=(?!")|\=(?=\s*"[^"]*"[^"]*$)/);
                                      $value=~s/^"//;
       $value=~s/"$//;
                                      (uc($key),$value);}
                split(/\s+(?=\w+\s*\=)/,$keystring);
     if (uc($hash{'TYPE'}) eq "OWNERSHIP") {      if (uc($hash{'TYPE'}) eq "OWNERSHIP") {
         $info{$hash{'TYPE'}}{$hash{'CATEGORY'}}{'CHMOD'}=$hash{'CHMOD'};          $info{$hash{'TYPE'}}{$hash{'CATEGORY'}}{'CHMOD'}=$hash{'CHMOD'};
         $info{$hash{'TYPE'}}{$hash{'CATEGORY'}}{'CHOWN'}=$hash{'CHOWN'};          $info{$hash{'TYPE'}}{$hash{'CATEGORY'}}{'CHOWN'}=$hash{'CHOWN'};
Line 44  while ($info=~/\<loncapa\s+(.*?)\>/isg) Line 52  while ($info=~/\<loncapa\s+(.*?)\>/isg)
     if ($data=~/\<($m)\>(.*?)\<\/$m\>/sgi) {      if ($data=~/\<($m)\>(.*?)\<\/$m\>/sgi) {
  my ($key,$value)=($1,$2);   my ($key,$value)=($1,$2);
  $info{$hash{'TYPE'}}{$hash{'DIST'}}{$hash{'TARGET'}}{$key}=$value;   $info{$hash{'TYPE'}}{$hash{'DIST'}}{$hash{'TARGET'}}{$key}=$value;
  print "$key\n\n$value\n\n\n\n";  # print "$key\n\n$value\n\n\n\n";
     }      }
         }          }
     }      }

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


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