NAME
    Taint::Runtime - Runtime enable taint checking

CREDITS
    C code was provided by "hv" on perlmonks.
    http://perlmonks.org/?node_id=434086

SYNOPSIS
      #!/usr/bin/perl -w

      use strict;
      use Taint::Runtime qw(taint_start is_tainted
                            taint untaint
                            taint_enabled);

      ### other operations here

      taint_start(); # taint should become active

      print taint_enabled() ? "enabled\n" : "not enabled\n";

      my $var = taint("some string");

      print is_tainted($var) ? "tainted\n" : "not tainted\n";

      $var = untaint($var);
      # OR
      untaint \$var;

      print is_tainted($var) ? "tainted\n" : "not tainted\n";

DESCRIPTION
    You probably shouldn't use this module. The most common place to use
    this script would be in a CGI type environment where the server can be
    trusted. This means that PERL5LIB and PERLLIB are known entities and the
    modules in them can be trusted.

    Generally tainting should be started before any processing of user data
    is done. For example, taint_start should be called before CGI parameters
    are loaded or user files or filenames are read.

    In general - the more secure your script needs to be - the earlier on in
    your program that tainting should be enabled. You probably really don't
    want to use this module in a setuid environment - in those cases -T on
    the commandline is the best policy.

NON-EXPORTABLE XS FUNCTIONS
    _start_taint()
        Sets PL_tainting

    _stop_taint()
        Sets PL_tainting

    _tainted()
        Returns a zero length tainted string.

FUNCTIONS
    taint_start
        Start taint mode.

    taint_stop
        Stop taint mode.

    taint
        Taints the passed in variable. Only works on writeable scalar
        values. If a scalar ref is passed in - it is modified. If a scalar
        is passed in (non ref) it is copied, modified and returned. If a
        value was undefined, it becomes a zero length defined and tainted
        string.

          taint(\$var_to_be_tainted);

          my $tainted_copy = taint($some_var);

    untaint
        Untaints the passed in variable. Only works on writeable scalar
        values. If a scalar ref is passed in - it is modified. If a scalar
        is passed in (non ref) it is copied, modified and returned. If a
        value was undefined it becomes an untainted undefined value.

          untaint(\$var_to_be_untainted);

          my $untainted_copy = untaint($some_var);

    taint_enabled
        Boolean - Is taint on.

    tainted
        Returns a zero length tainted string.

    is_tainted
        Boolean - True if the passed value is tainted.

    taint_env
        Convenience function that taints the values of %ENV.

    taint_deeply
        Convenience function that attempts to deply recurse a structure and
        mark it as tainted.

AUTHOR
    Paul Seamons (2005)

    C stub functions by "hv" on perlmonks.org

LICENSE
    This module may be used and distributed under the same terms as Perl
    itself.

