in reply to Question of scope and syntax

For your 1st warning message, I think you can just change:
opendir(my $currentDirectory, my $pathToDirectory) || die "You sure +that exists, dummy?";

to:

opendir(my $currentDirectory, $pathToDirectory) || die "You sure tha +t exists, dummy?";

For your 2nd warning, this line is definitely the culprit, but I'm not sure what you're trying to do:

while ($boxEnd >= my $boxBegining, $boxBegining++) {

Maybe...

while ($boxEnd >= $boxBegining) { $boxBegining++;