#!/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 %hash; my $default_dir = "C:/Main/work"; if (@ARGV == 1) { $default_dir = shift @ARGV ) elsif (@ARGV >1) { die "too many command line args\n"; }; 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'],); return; }