I am not familiar with Array::Compare, and all of its options, but how about utilizing a "chomp and slurp mode" combination to flatten the file contents? Then the rest of the array prep might look like this:
- chomp and slurp
- filter out special characters
- split and push
just a quick thought... hope it helps.
Info: Perl Maven Slurp Mode