sub untaint_name { # replace non-word chars with nothing my $name = shift; $name =~ s/\W//g; return $name; };