for my $file (glob('*.xml') ) { if (-r "$file.bak" ) { print "backup found for $file\n"; } }