]> jspc29.x-matter.uni-frankfurt.de Git - daqtools.git/commitdiff
Making xml-db.pl bit more compatible with older PERL versions
authorAndreas Neiser <neiser@kph.uni-mainz.de>
Thu, 24 Oct 2013 07:29:41 +0000 (09:29 +0200)
committerAndreas Neiser <neiser@kph.uni-mainz.de>
Thu, 24 Oct 2013 07:29:41 +0000 (09:29 +0200)
xml-db/xml-db.pl

index 052339647fe3bf2cb0e1b39269ebb3414fd3d277..6fe5c6734b8661657eaea93e9ebedc2a803ba60e 100755 (executable)
@@ -11,7 +11,6 @@ use FindBin qw($RealBin);
 use Data::Dumper;
 use Storable qw(lock_store);
 
-
 # some default config options
 # and provide nice help documentation
 # some global variables, needed everywhere
@@ -175,9 +174,10 @@ sub MakeOrMergeDbItem {
   }
 
   # add all attributes
-  foreach my $a (keys %$n) {
-    next if $a eq 'name' or $a eq 'address';
-    $dbitem->{$a} = $n->getAttribute($a);
+  foreach my $a ($n->attributes()) {
+    my $a_name = $a->getName();
+    next if $a_name eq 'name' or $a_name eq 'address';
+    $dbitem->{$a_name} = $a->getValue();
   }
 
   # find required attributes from first ancestor which knows