in reply to error showing LWP request failed

You have my $diff twice in the same scope.

You'll be alerted to that (and other problems) by adding these lines to the top of your code:

use strict; use warnings;

As you're a beginner, you can get more verbose messages by also adding:

use diagnostics;

Perl can also provide details of any problems with opening those directories if you add $! to your error message - see readdir for example usage.

Additional Information:

You might also consider using XML::Simple STRICT MODE. The documentation says: "the following common mistakes will be detected and treated as fatal errors: ...".

-- Ken