This is how I currently delete files and directories recursively
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 files/dirs that need to be deleted, so I would like to see a better solution other than calling "rm -rf" for each file/dir.
Maybe combine a list of files/dirs in array and then pass this array to a single "rm -rf" call?