Ignore:
Timestamp:
2005-07-19T16:18:25+12:00 (19 years ago)
Author:
kjdon
Message:

added 'use strict' to all classifiers, and made modifications (mostly adding 'my') to make them compile

File:
1 edited

Legend:

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

    r10218 r10253  
    4343use sorttools;
    4444
     45use strict;
     46no strict 'refs'; # allow filehandles to be variables and viceversa
     47
    4548sub BEGIN {
    46     @ISA = ('BasClas');
     49    @DateList::ISA = ('BasClas');
    4750}
    4851
     
    8891    my $self = (defined $hashArgOptLists)? new BasClas($classifierslist,$inputargs,$hashArgOptLists): new BasClas($classifierslist,$inputargs);
    8992
     93    if ($self->{'info_only'}) {
     94    # don't worry about any options etc
     95    return bless $self, $class;
     96    }
     97
    9098    # Manually set $self parameters.
    9199    $self->{'list'} = {};
     
    172180    # classifications, unless nogroup is specified
    173181    if ((scalar @$classlistref) <= 39 && !$self->{'nogroup'}) {
    174     foreach $subOID (@$classlistref) {
     182    foreach my $subOID (@$classlistref) {
    175183        push (@{$classifyinfo->{'contains'}}, {'OID'=>$subOID});
    176184    }
     
    184192    if (!$self->{'nogroup'}) { # hlist of year+month pairs
    185193        # single level of classifications
    186         foreach $classification (@$classlistref) {
     194        foreach my $classification (@$classlistref) {
    187195        my $date = $self->{'list'}->{$classification};
    188196        $date =~ s/^(\d\d\d\d)(\d\d).*$/$1&nbsp;_textmonth$2_/;
     
    196204       
    197205    } else { # don't group - individual years and months
    198         foreach $classification (@$classlistref) {
     206        foreach my $classification (@$classlistref) {
    199207        my $date = $self->{'list'}->{$classification};
    200208        $date =~ s/^(\d\d\d\d)(\d\d).*$/$1&nbsp;_textmonth$2_/;
     
    223231            push (@{$yearclassify->{'contains'}}, $monthclassify);
    224232       
    225             foreach $subsubOID
     233            foreach my $subsubOID
    226234            (@{$classhash->{$subclass}->{$subsubclass}}) {
    227235                push (@{$monthclassify->{'contains'}},
     
    236244    # not by month
    237245    # first split up the list into separate year classifications
    238     foreach $classification (@$classlistref) {
     246    foreach my $classification (@$classlistref) {
    239247        my $date = $self->{'list'}->{$classification};
    240248        $date =~ s/^(\d\d\d\d).*$/$1/;
     
    248256    $classhash = $self->compactlist ($classhash);
    249257    }
    250     foreach $subclass (sort keys %$classhash) {
     258    foreach my $subclass (sort keys %$classhash) {
    251259    my $tempclassify = $self->get_entry($subclass, "DateList");
    252     foreach $subsubOID (@{$classhash->{$subclass}}) {
     260    foreach my $subsubOID (@{$classhash->{$subclass}}) {
    253261        push (@{$tempclassify->{'contains'}}, {'OID'=>$subsubOID});
    254262    }
Note: See TracChangeset for help on using the changeset viewer.