use Win32::File qw/GetAttributes/; my $attrs; GetAttributes("some_file", \$attrs); if ($attrs | HIDDEN) { . . .