From 47565d423f40f4fbbbb032dcc6fa2f6670bfafab Mon Sep 17 00:00:00 2001 From: Haru Date: Sat, 15 Nov 2014 17:22:42 +0100 Subject: Follow-up to 61fc83fd7dd51e9a88ac7e6264692fcf561a37f7 Compatibility fix for older versions of Perl Signed-off-by: Haru --- tools/HPMHookGen/HPMDataCheckGen.pl | 2 +- tools/HPMHookGen/HPMHookGen.pl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'tools/HPMHookGen') diff --git a/tools/HPMHookGen/HPMDataCheckGen.pl b/tools/HPMHookGen/HPMDataCheckGen.pl index 01728341d..06b58127a 100644 --- a/tools/HPMHookGen/HPMDataCheckGen.pl +++ b/tools/HPMHookGen/HPMDataCheckGen.pl @@ -21,7 +21,7 @@ my %out; foreach my $file (@files) { my $xml = new XML::Simple; my $data = $xml->XMLin($file, ForceArray => 1); - my $filekey = (keys $data->{compounddef})[0]; + my $filekey = (keys %{ $data->{compounddef} })[0]; next unless $data->{compounddef}->{$filekey}->{includes}; # means its a struct from a .c file, plugins cant access those so we don't care. next if $data->{compounddef}->{$filekey}->{compoundname}->[0] =~ /::/; # its a duplicate with a :: name e.g. struct script_state {<...>} ay; my @filepath = split(/[\/\\]/, $data->{compounddef}->{$filekey}->{location}->[0]->{file}); diff --git a/tools/HPMHookGen/HPMHookGen.pl b/tools/HPMHookGen/HPMHookGen.pl index 3daf742bc..c11293d93 100755 --- a/tools/HPMHookGen/HPMHookGen.pl +++ b/tools/HPMHookGen/HPMHookGen.pl @@ -260,7 +260,7 @@ foreach my $file (@files) { # Loop through the xml files my $xml = new XML::Simple; my $data = $xml->XMLin($file, ForceArray => 1); - my $filekey = (keys $data->{compounddef})[0]; + my $filekey = (keys %{ $data->{compounddef} })[0]; my $loc = $data->{compounddef}->{$filekey}->{location}->[0]; next unless $loc->{file} =~ /src\/(map|char|login)\//; my $servertype = $1; -- cgit v1.2.3-60-g2f50