Perl Security: 4. Handling tainted data Detecting tainted data It's very easy to detect if a certain value is tainted or not: Remember that outside an eval, the program will not abort. Thus, sub is_tainted { return ! eval {join ('',@_), kill 0; return 1; } We can also use the Taint module available at CPAN: use Taint; warn 'Tainted data!' if tainted ($var1, @var2);