[LON-CAPA-cvs] cvs: loncom /localize/localize synch.pl

www lon-capa-cvs@mail.lon-capa.org
Fri, 26 Sep 2003 14:13:35 -0000


www		Fri Sep 26 10:13:35 2003 EDT

  Added files:                 
    /loncom/localize/localize	synch.pl 
  Log:
  Work on utility to synch lexicon files.
  
  

Index: loncom/localize/localize/synch.pl
+++ loncom/localize/localize/synch.pl
sub readlexicon {
    my $fn=shift;
    open(IN,$fn);
    my %lexicon=();
    my $contents=join('',<IN>);
    close(IN);
    $contents=~s/package Apache\:[^\;]+//;
    $contents=~s/use base[^\;]+//;
    eval($contents.'; %lexicon=%Lexicon;');
    delete $lexicon{'_AUTO'};
    delete $lexicon{'char_encoding'};
    delete $lexicon{'language_code'};
    return %lexicon;
}

&readlexicon('de.pm');