Changeset 26449


Ignore:
Timestamp:
11/07/12 16:17:13 (8 years ago)
Author:
ak19
Message:

Some regexp variables were undefined owing to the caller method being a variant of write_cfg_file which doesn't define these regexp variables. Need to first check whether these vars are defined are not.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/cfgread.pm

    r24586 r26449  
    209209        } elsif ($key =~ /$arrayexp/) {
    210210        &write_cfg_line ('COLCFG', [$key, @{$data->{$key}}]);
    211         } elsif ($key =~ /$hashexp/) {
     211        } elsif (defined $hashexp && $key =~ /$hashexp/) {
    212212        foreach my $k (keys (%{$data->{$key}})) {
    213213            &write_cfg_line ('COLCFG', [$key, $k, $data->{$key}->{$k}]);
    214214        }
    215         } elsif ($key =~ /$arrayarrayexp/) {
     215        } elsif (defined $arrayarrayexp && $key =~ /$arrayarrayexp/) {
    216216        foreach my $k (@{$data->{$key}}) {
    217217            &write_cfg_line ('COLCFG', [$key, @$k]);
    218218        }
    219         } elsif ($key =~ /$hashhashexp/) {
     219        } elsif (defined $hashhashexp && $key =~ /$hashhashexp/) {
    220220        foreach my $k (keys (%{$data->{$key}})) {
    221221            foreach my $p (keys (%{$data->{$key}->{$k}})) {
Note: See TracChangeset for help on using the changeset viewer.