I'd suggest you go read the perlsec manpage. It explains taint, and why and when to use it. In your case, I'm not sure why you're using taint, as (at least in the snipplet you supplied), you're not really doing anything with the data you're reading. Just making sure you're using the full path to 'ls' is enough - but you don't really need taint for that.