#!/usr/bin/perl use warnings; use strict; use XML::Simple; use Carp; use File::Find; use File::Spec::Functions qw( canonpath ); use Data::Dumper; my @ARGV ="C:/Main/work"; die "Need directories\n" unless @ARGV; find( sub { return unless ( /(_service\.xml)$/ and -f ); Hash_information(); return; }, @ARGV ); sub Hash_information { my $path= $_; my $xml = new XML::Simple; my $data = $xml->XMLin("$path", ForceArray => [ 'Service','SystemReaction','SW','HW','Component' , 'BM'], KeyAttr=>{Service=>'Id'} ); print Dumper ($data); return; }