diff options
Diffstat (limited to 'ConfigReader.pm')
-rw-r--r-- | ConfigReader.pm | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ConfigReader.pm b/ConfigReader.pm index 379d144..d5ec8b1 100644 --- a/ConfigReader.pm +++ b/ConfigReader.pm @@ -41,6 +41,13 @@ sub new { my $xml = new XML::Simple (KeyAttr=>[]); $self->{data} = $xml->XMLin($fileName); + if (ref($self->{data}->{category}) eq "HASH") { + # one element alone + my @categories; + push @categories, $self->{data}->{category}; + $self->{data}->{category} = undef; + push @{$self->{data}->{category}}, @categories; + } $self->{catLen} = scalar(@{$self->{data}->{category}}); $self->{currCat} = -1; |