foreach (@taxonomy_file_url) { &getFile($_, "taxonomy", $local_taxonomy_directory); } #### foreach (@taxonomy_file_url) { if (-e $_) { # does the file exist unlink($_) #delete it } &getFile($_, "taxonomy", $local_taxonomy_directory); }