Picture this: you're running dangerously low on disk space, so you invest in a brand new external drive. Time to migrate your development environment and get back to coding. You fire up those trusty setup scripts that have served you well for months, maybe years, and then...
Error.
What follows is the familiar developer dance of confusion and frustration. You scrutinize your scripts, double-check environment variables, recreate virtual environments, and question everything you thought you knew. In my case, I was staring at this cryptic message:
Unrecognized character \x05; marked by <-- HERE after <-- HERE near column 2 at ._Makefile.PL line 1.
The plot twist? When I recreated the exact same setup in /tmp, everything worked flawlessly.
The Mystery of the Phantom Files
A quick folder comparison revealed the smoking gun: nearly every file on my external drive had acquired a mysterious ._ companion. These weren't files I had created—they appeared seemingly out of nowhere.
The Real Culprit: macOS's Metadata Workaround for ExFAT
Here's what's actually happening behind the scenes. Most external drives ship with ExFAT formatting, which is great for cross-platform compatibility but has one significant limitation: it doesn't support Unix permissions or extended metadata that macOS relies on.
Apple's solution? Store that metadata separately in hidden ._FILENAME files. Clever, but problematic when your build tools start processing these metadata files as if they were actual source code.
When my compilation process tried to build *.Makefile.PL files, it wasn't just finding the legitimate Makefile.PL—it was also attempting to compile ._Makefile.PL, which contains binary metadata instead of valid Perl code. Hence the "unrecognized character" error.
The Simple Fix
The solution is straightforward: reformat your external drive to APFS (Apple File System). APFS natively supports the metadata and permissions that macOS expects, eliminating the need for those troublesome ._ files.
Steps to resolve:
1. Back up any important data from your external drive
2. Open Disk Utility
3. Select your external drive
4. Choose "Erase" and select APFS as the format
5. Restore your development environment
Your build scripts will thank you, and you can get back to what matters: writing code instead of debugging phantom errors caused by phantom files.