I'm trying to get a list of the current directories using Win98. Here's what I have:
opendir THISDIR, "." or die "serious dainbramagae: $!";
@allfiles = readdir THISDIR;
closedir THISDIR;
while (@allfiles) {
$allfiles[0] =~ s/\s*\S+\.\S+\.*\S*\.*\S*\s*//;
$array[$i] = $allfiles[0];
shift @allfiles;
$i++
}
shift @array;
s/\s*//g;
my $count = @array;
$count++;
while (@array2, $k<$count) {
print "[$k] $array2[$j]\t";
$j++;
$k++;
}
I started off with some code from programming perl 2nd edition. The only problem is that I end up having 80 some array values, most of which are just spaces. I can't seem to get rid of them. Does anyone have any ideas? Would I be better off getting input from a dir system command? If so, how should I do this? Thanx.
- p u n k k i d
"Reality is merely an illusion, albeit a very persistant one."
-Albert Einstein