use strict; use warnings; use File::Find; my @start_dirs = qw(/home/bob/mytemp); sub rm_empty_file { my $file = $File::Find::name; if ( -f $file and -z $file ) { print "removing empty file: $file\n"; #TODO: unlink $file or die "cannot remove $file - $!"; } } find( { wanted => \&rm_empty_file, no_chdir => 1 }, @start_dirs );