my $safe = $attach_name;
$safe =~ s/[^\w\s\-\.]/_/g;
That won't help. If $attach_name is tainted, $safe will still be tainted.
Oops, I wasn't;t even thinking -t, duh! :) I was looking at the regex and
the " replace any unsafe characters with underscores" part, sorry :)
Here's how to do it:
# copy attachment name, remove "bad" characters
(my $safe = $attach_name) =~ s/[^\w\s.-]+//g;
# and then $1-ize it
($safe) = $safe =~ /([\w\s.-]+)/;
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>