(OP here)
God, I knew it was something stupid and obvious like that! But why on earth would Perl not return an error when opening (not opendiring) a directory? Aargh.
Thank you (both) for this. This task doesn't require any fancy tree-walking, the directory will just be a flat folder with files in it, so this is pretty much all I need for this purpose.