Thanks Again!!!! curtisb = Upcoming Perl Programmer "Start Slow and Small!!!!"#!/usr/bin/perl -w use Cwd; print "Enter start directory: $workdir"; chomp($workdir = <STDIN>); sub scandir { my ($workdir) = shift; #c:\mydocu~1\Netscape my ($startdir) = &cwd; #c:\mydocu~1\perl chdir($workdir) or die "Unable to change to $workdir:$!\n"; opendir(DIR, ".") or die "Unable to open $workdir:$!\n"; my @files = readdir(DIR) or die "Unable to read $workdir:$!\n"; closedir(DIR); foreach my $file (@files) { next if ($file eq "."); next if ($file eq ".."); if (-d $file) { &scandir($file); next; } if ($file eq '/\.log$/i || /\.\d+\w+\-\d+\wm$/i') { unlink($file) || warn "Unable to delete $file: $!\n"; } else{ print "Found File: $file\n"; } chdir($startdir) or die "Unable to change to $startdir: $!\n"; } } &scandir(".");
In reply to First code test view by curtisb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |