use XML::Simple; use strict; use warnings; my $xml = < XML my $config = XMLin ($xml); processhash ($config, '$config'); sub processhash { my ($href, $path, @junk) = @_; my %configr = %$href; foreach my $k (keys %configr) { print qq|$path :: $k = $configr{$k}\n|; if ($configr{$k} =~ m/HASH/i) { processhash ($configr{$k}, qq|$path -> {'$k'}|); } } } #### $config :: outputText = HASH(0x2106718) $config -> {'outputText'} :: value = * $config -> {'outputText'} :: id = AdjustCCDetails_ReasonCode_table_required_id $config -> {'outputText'} :: styleClass = required