So I have a programming assignment where I need to parse multiple XML files and return their attributes in a readable format. Currently the script parses all of the files and stores all the details for each file at each position of an array. An example of the desired output would be:

J MIG-49 at location "85,20,0.1" is moving to "0.5,-0.5,-300

Below is the XML code for an example.

<?xml version='1.0'?>
And here is my current Perl script.

my $count=0;
opendir (DIR, "../folder") or die "$!";
my @feeds = grep {/threats.*?\.xml/}  readdir DIR;
close DIR;
# The above 3 lines read in the XML files and store them in array feeds.
for $threats(@feeds) {
   open (READ, $threats)||die"$!";
   flock(READ, 1) || die "Can't lock xml: $!";
   while (<READ>) {
   close READ;
print @all; # report