Changeset 15703

Show
Ignore:
Timestamp:
26.05.2008 16:32:50 (11 years ago)
Author:
mdewsnip
Message:

Added "use strict", and fixed a whole bunch of warnings as a consequence.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/perllib/classify.pm

    r15702 r15703  
    3030require util; 
    3131require AllList; 
     32 
    3233use gsprintf; 
    33  
    34 #use GDBM_File; 
     34use strict; no strict 'subs'; 
    3535use unbuildutil; 
    3636 
     
    4242 
    4343 
    44 $oid_to_clids = {}; 
     44my $oid_to_clids = {}; 
    4545 
    4646sub load_classifier_for_info { 
     
    7979     unshift (@INC, $colclassdir); 
    8080     
    81     foreach $classifyoption (@$classify_list) { 
     81    foreach my $classifyoption (@$classify_list) { 
    8282 
    8383    # get the classifier name 
     
    146146    my ($classifiers) = @_; 
    147147     
    148     foreach $classobj (@$classifiers) { 
     148    foreach my $classobj (@$classifiers) { 
    149149    $classobj->init(); 
    150150    } 
     
    161161    my $children = undef; 
    162162 
    163     $childs = $doc_db_hash->{'contains'}; 
    164     if (defined ($childs)) { 
    165     $childs =~ s/\@$//;  #remove trailing @ 
    166     $childs =~ s/^\"\.//; #remove initial ". 
    167     @$children = split /\;\"\./, $childs; 
    168      
     163    my $contains = $doc_db_hash->{'contains'}; 
     164    if (defined ($contains)) { 
     165    $contains =~ s/\@$//;  #remove trailing @ 
     166    $contains =~ s/^\"\.//; #remove initial ". 
     167    @$children = split /\;\"\./, $contains; 
    169168    } 
    170169 
     
    202201    my ($doc_obj, $cursection, $doc_db_hash) = @_; 
    203202  
    204     foreach $key (keys %$doc_db_hash) { 
     203    foreach my $key (keys %$doc_db_hash) { 
    205204    #don't need to store these metadata 
    206205    next if $key =~ /(thistype|childtype|contains|docnum|doctype|classifytype)/i; 
     
    221220 
    222221    my @entries = split(/\n/, $gdb_str_ref); 
    223     foreach $entry (@entries) { 
     222    foreach my $entry (@entries) { 
    224223    my($key, $value) = ($entry =~ /^<([^>]*)>(.*?)$/ ); 
    225224    $hashref->{$key} .= '@' if defined $hashref->{$key}; 
     
    288287    my ($classifiers, $doc_obj) = @_; 
    289288     
    290     foreach $classobj (@$classifiers) { 
     289    foreach my $classobj (@$classifiers) { 
    291290    my $title = $classobj->{'title'}; 
    292291    $classobj->classify($doc_obj); 
     
    309308    # get each of the classifications 
    310309    my $next_classify_num = 1; 
    311     foreach $classifier (@$classifiers) 
     310    foreach my $classifier (@$classifiers) 
    312311    { 
    313312    my $classifier_info = $classifier->get_classify_info($gli); 
     
    456455    return $classifyinfo->{'numleafdocs'} if (defined $classifyinfo->{'numleafdocs'}); 
    457456 
    458     foreach $content (@{$classifyinfo->{'contains'}}) { 
     457    foreach my $content (@{$classifyinfo->{'contains'}}) { 
    459458    if (defined $content->{'OID'}) { 
    460459        # found a book