The perl-way:
#!/usr/bin/perl
opendir(DIR,".") or die "$@:$!";
while ($in = readdir(DIR)) {
next unless -f $in;
($out = $in) =~ s/[^a-zA-Z0-9._-]//g;
warn "$@:$!" unless rename $in, $out;
}
closedir(DIR);
The regex filters onle a-zA-Z ... as valid chars, there is no checking for empty target names.