in reply to Re: What's your favourite method of untainting?
in thread What's your favourite method of untainting?

Whoops - that's a typo. It should be:

($foo) = ($val =~ /^(?!.).$/);

and the essence of it is, that it never accepts any incoming data (albeit in a roundabout way).