#!perl -w
use strict;
use Cwd;
use Win32::File qw(GetAttributes);
use constant HIDDEN => 2;
my $attribs;
my $dir = cwd();
print $dir,$/;
opendir( DIR, $dir ) or die "Couldn't open $main::DIR: $!\n";
my @vis_files = grep { -f $dir.'/'.$_ and GetAttributes($_, $attrib
+s) and not ($attribs & HIDDEN) } readdir(DIR);
closedir( DIR ) or warn "Couldn't close $main::DIR: $!\n";
print $_, $/ for @vis_files;
Now, I KNOW I shouldn't have to be defining my own HIDDEN constant, as this and all the others are apparently exported into main by Win32::File.
However, I have tried everything to use these exported constants including:
- HIDDEN
- $HIDDEN
- Win32::File::HIDDEN
- $Win32::File::HIDDEN
and either get 'bareword; noises, or if I turn off strict 'not numeric' noises.
I also investingated Win32::File.pm and whilst there is a qw( list ) of the constant names exported, I can see nowhere where they aquire any values?
Anyone who can explain
- How to use them?
- How they (are meant) to aquire values
Will earn the customary ++ and my grateful thanks. |