in reply to File deletion
use strict; my $file_location = shift; open(FH,">","log.txt") or die "unable to open file log.txt"; my @files = <$file_location/*>; foreach my $file (@files){ system("rm $file"); unless( $? == -1 ){ print FH "\n$file is deleted.."; } else{ print FH "\n$file is not deleted.. $!"; } } close FH;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: File deletion
by marto (Cardinal) on May 06, 2013 at 12:16 UTC | |
|
Re^2: File deletion
by marto (Cardinal) on May 06, 2013 at 12:19 UTC | |
|
Re^2: File deletion
by thezip (Vicar) on May 06, 2013 at 18:29 UTC |