my $nr = unlink @files_to_delete; if( $nr != scalar @files_to_delete ) { print "uh-oh: helpful error message here"; }