use strict;
use gfrmGlobals;
my @files = ();
my $flNm = "";
opendir (DIR, $GCdfltDBexpPrmPthNm) || die "can't open directory\n";
@files = readdir(DIR);
closedir (DIR);
foreach $flNm (@files)
{
if ( -f $flNm) { print "is a file: $flNm\n"; }
elsif ( -d $flNm) { print "is a dir: $flNm\n"; }
else { print "neither file nor dir: $flNm\n"; }
}
####
gfrmDev$ cd DBexportFiles
gfrmDev$ ls -l
total 1536
-rw-r--r-- 1 andynic staff 66192 17 Feb 17:43 export_of_gfrm_20110217_174314.zip
-rw-r--r-- 1 andynic staff 66192 17 Feb 17:51 export_of_gfrm_20110217_175005.zip
-rw-r--r-- 1 andynic staff 66193 17 Feb 18:30 export_of_gfrm_20110217_183048.zip
-rw-r--r-- 1 andynic staff 66193 17 Feb 22:08 export_of_gfrm_20110217_220832.zip
-rw-r--r-- 1 andynic staff 505830 17 Feb 20:27 importLogOf_export_of_gfrm_20110217_183048.log
drwxr-xr-x 7 andynic staff 238 18 Feb 12:52 xxxx
####
gfrmDev$ perl -w x.pl
is a dir: .
is a dir: ..
is a file: .DS_Store
neither file nor dir: export_of_gfrm_20110217_174314.zip
neither file nor dir: export_of_gfrm_20110217_175005.zip
neither file nor dir: export_of_gfrm_20110217_183048.zip
neither file nor dir: export_of_gfrm_20110217_220832.zip
neither file nor dir: importLogOf_export_of_gfrm_20110217_183048.log
neither file nor dir: xxxx