sub wanted { my ($file)=$_; if (-d $file) { $File::Find::prune = 1; return; } my $dir_to_make = categorize($file); File::Path::make_path($dir_to_make); File::Copy::move($file, $dir_to_make); }