use IO::Dir qw[DIR_UNLINK]; tie my %d, 'IO::Dir', '.', DIR_UNLINK; #### use IO::Dir; tie my %d, 'IO::Dir', '.', 1;