@complete{@arr_a} = ...; #### #!/usr/bin/perl use warnings; use strict; use Data::Dumper; use XML::LibXML; my $xml = 'XML::LibXML'->load_xml( string => <<'__XML__'); __XML__ my %complete; for my $node ($xml->documentElement->findnodes('*')) { my ($a, $b, $c) = map $node->getAttribute($_), 'a', 'b', 'c'; if (3 == grep defined, $a, $b, $c) { my @arr_a = split (/ /, $a); my @arr_b = split (/ /, $b); my @arr_c = split (/ /, $c); @complete{@arr_a} = map [ shift @arr_b, shift @arr_c ], @arr_a; } else { print "Warning! \n"; } } print Dumper \%complete;