---
name: "CGI::Untaint::object"
section: "3pm"
platform: "linux"
package: "libcgi-untaint-perl"
version: "1.26-8"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/CGI::Untaint::object"
---

# CGI::Untaint::object(3pm)

base class for Input Handlers

## NAME

CGI::Untaint::object - base class for Input Handlers

## SYNOPSIS

```
  package MyUntaint::foo;
  use base 'CGI::Untaint::object';
  sub _untaint_re {
    return qr/$your_regex/;
  }
  sub is_valid {
    my $self = shift;
    return is_ok($self->value);
  }
  1;
```

## DESCRIPTION

This is the base class that all Untaint objects should inherit from.

## METHODS TO SUBCLASS

### is\_valid / \_untaint\_re

Your subclass should either provide a regular expression in \_untaint\_re (and yes, I should really make this public), or an entire is\_valid method.

## METHODS TO CALL

### value

This should really have been two methods, but too many other modules now rely on the fact that this does double duty. As an accessor, this is the 'raw' value. As a mutator it's the extracted one.

### re\_all / re\_none

Regular expressions to match anything, or nothing, untained.  These should only be used if you have already validated your entry in some way that means you completely trust the data.

### untainted

Are we clean yet?
