Q:

-T option in perl

What is the -T flag in Perl used for?

A:

It enables "taint mode," a dataflow analysis that prevents potentially unsafe operations using untrusted inputs.
For example, it might seem reasonable to store a new user's details with
open my $fh, ">", "/var/myservice/$username"
  or die "...";
print $fh ...;

To illustrate how this is useful, what if a malicious user gives a username of ../../../etc/passwd and your service runs as root?
Taint mode won't allow the code above to run if the value of $username came from the command line or as a CGI form parameter.
The perlsec documentation shows how to "untaint" untrusted inputs to be sure they're safe.

