--- loncom/build/Attic/parse.pl 2000/12/05 15:30:47 1.1 +++ loncom/build/Attic/parse.pl 2000/12/07 20:42:13 1.3 @@ -3,19 +3,27 @@ # Scott Harrison # 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; + +# -------------------------------------------- Read in master data file open IN,"<$file"; my @lines=; close IN; + my $info=join('',@lines); my $info2=$info; # value to allow for meta data group retrieval my %ihash; # big data storage object while ($info=~/\/isg) { 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") { $info{$hash{'TYPE'}}{$hash{'CATEGORY'}}{'CHMOD'}=$hash{'CHMOD'}; $info{$hash{'TYPE'}}{$hash{'CATEGORY'}}{'CHOWN'}=$hash{'CHOWN'}; @@ -44,7 +52,7 @@ while ($info=~/\/isg) if ($data=~/\<($m)\>(.*?)\<\/$m\>/sgi) { my ($key,$value)=($1,$2); $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"; } } }