#!/usr/bin/perl use strict; use Cwd 'abs_path'; use File::Basename; use local::db; use config; for my $dl (local::db::download->retrieve_all) { $dl->delete if not -d $config::config{files_dir}.'/'.$dl->category->name.'/'.$dl->download_id; }