in reply to Access given folder to parse a file

What errors do you get?

Maybe you want to explain what the following line in your program does:

my $files = ($directory, "\", $file);

What steps have you undertaken to verify that this line works?