# filter any unwholesome file names my @reason; push @reason, "... a file with that name doesn't exist" if ! -f $file; push @reason, "... it starts with a dot" if $file =~ /^\./; ... if (@reason) { warn "Rejecting filename '$file' because "; warn $_ for @reason; next; }; #### $file =~ /^\w[-_\w]+\.\w+$/ or push @reason, '... it doesn't look like a sane filename';