#!/usr/bin/perl -wT
In this chapter, they have started like this:
#!/usr/bin/perl -w
The difference is the -T option, which enables
Perl's taint mode. Taint mode tells Perl to keep track of data
that comes from the user and avoid doing anything insecure with it.
Because our examples this chapter intentionally showed insecure ways
of doing things, they wouldn't have worked with the
-T flag, thus we omitted it. From this it should
be clear, however, that taint mode is generally a very good thing.
The purpose of taint mode is to not allow any data from outside your
application from affecting anything else external to your
application. Thus, Perl will not allow user-inputted values to be
used in an eval, passed through a shell, or used in any of the Perl
commands that affect external files and processes. It was created for
situations when security is important, such as writing Perl programs
that run as root or CGI scripts. You should
always use taint mode in your CGI scripts.