$|=1; # So it works in the Open Perl IDE

# Move to the directory. Use / instead of \. Die if it didn't work
chdir "c:/Windows" or die "Changing directory failed: $!";

@files = glob "*.exe"; # get all files ending in exe

$n = $#files + 1; # Get the number of elements

print "There are $n EXE files in your Windows directory";
