in reply to quoting for backticks

if ($filename =~ m/^([a-zA-Z0-9\.\_\-\/\\]+)$/) { $filename = $1 $x = `foo \"$filename\" | bar | baz`; } else { print "The filename you entered contains illegal characters."; }
This is now untainted too, if you know something about tainting.