This is how I am currently recursively deleting files and directories
foreach my $row(keys %$rows)
{
my $md5 = $rows->{$row}->{'md5'};
my $path = "/some/path/jpg/".substr( $md5, 0, 3 )."/$md5";
`rm -rf $path`;
print "removed - ".$path."\n";
}
There are hundreds of thousands of / dirs files that need to be deleted, so I would like to see a better solution besides calling "rm -rf" for each / dir file.
Maybe combine the list of / dirs files in an array and pass this array to a single rm -rf call?
source
share