in reply to cant open files from a directory

You sure do love your warnings ...

#!usr/bin/perl -w use strict; use warnings; ...

Next step would be the upgrade to being fatal ...

use warnings FATAL => 'all';

But, there is more: fatal warnings are a ticking time bomb (via chromatic), and elsewhere around these parts.