--- loncom/lonnet/perl/lonnet.pm 2006/05/15 23:40:36 1.735 +++ loncom/lonnet/perl/lonnet.pm 2006/05/16 15:42:15 1.736 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.735 2006/05/15 23:40:36 albertel Exp $ +# $Id: lonnet.pm,v 1.736 2006/05/16 15:42:15 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -5415,16 +5415,16 @@ sub metadata { } else { $metaentry{':packages'}=$package.$keyroot; } - foreach (sort keys %packagetab) { + foreach my $pack_entry (keys(%packagetab)) { my $part=$keyroot; $part=~s/^\_//; - if ($_=~/^\Q$package\E\&/ || - $_=~/^\Q$package\E_0\&/) { - my ($pack,$name,$subp)=split(/\&/,$_); + if ($pack_entry=~/^\Q$package\E\&/ || + $pack_entry=~/^\Q$package\E_0\&/) { + my ($pack,$name,$subp)=split(/\&/,$pack_entry); # ignore package.tab specified default values # here &package_tab_default() will fetch those if ($subp eq 'default') { next; } - my $value=$packagetab{$_}; + my $value=$packagetab{$pack_entry}; my $unikey; if ($pack =~ /_0$/) { $unikey='parameter_0_'.$name; @@ -5472,11 +5472,12 @@ sub metadata { my $dir=$filename; $dir=~s|[^/]*$||; $location=&filelocation($dir,$location); - foreach (sort(split(/\,/,&metadata($uri,'keys', - $location,$unikey, - $depthcount+1)))) { - $metaentry{':'.$_}=$metaentry{':'.$_}; - $metathesekeys{$_}=1; + my $metadata = + &metadata($uri,'keys', $location,$unikey, + $depthcount+1); + foreach my $meta (split(',',$metadata)) { + $metaentry{':'.$meta}=$metaentry{':'.$meta}; + $metathesekeys{$meta}=1; } } } else { @@ -5485,8 +5486,9 @@ sub metadata { $unikey.='_'.$token->[2]->{'name'}; } $metathesekeys{$unikey}=1; - foreach (@{$token->[3]}) { - $metaentry{':'.$unikey.'.'.$_}=$token->[2]->{$_}; + foreach my $param (@{$token->[3]}) { + $metaentry{':'.$unikey.'.'.$param} = + $token->[2]->{$param}; } my $internaltext=&HTML::Entities::decode($parser->get_text('/'.$entry)); my $default=$metaentry{':'.$unikey.'.default'}; @@ -5532,11 +5534,12 @@ sub metadata { my $dir=$filename; $dir=~s|[^/]*$||; $location=&filelocation($dir,$location); - foreach (sort(split(/\,/,&metadata($uri,'keys', - $location,'_rights', - $depthcount+1)))) { - #$metaentry{':'.$_}=$metacache{$uri}->{':'.$_}; - $metathesekeys{$_}=1; + my $rights_metadata = + &metadata($uri,'keys',$location,'_rights', + $depthcount+1); + foreach my $rights (split(',',$rights_metadata)) { + #$metaentry{':'.$rights}=$metacache{$uri}->{':'.$rights}; + $metathesekeys{$rights}=1; } } }