in reply to Delete from array

why don't you use a hash to store shouldexist so you can delete by name?
something like
%shouldexist = ( 'filename1' => 1, .. 'filenamen' => 1 ); #or just %shouldexist = map {$_ => 1} @shouldexist;
so you can simply do
for(@doexist) { delete $shouldexist{$_}; }
if you whant to do the same using an array you have to scan @shouldexist on each iteration and delete when match (slower)