GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Input::Validator::Field(3) User Contributed Perl Documentation Input::Validator::Field(3)

Input::Validator::Field - Field object

    $validator->field('foo');
    $validator->field(qw/foo bar/);
    $validator->field([qw/foo bar baz/]);

Field object. Used internally.

Error messages.

    $field->deflate(sub { s/foo/bar/ });

Use this when you want to change value of field after validation.

    $field->error('Invalid input');
    my $error = $field->error;

Field error.

    $field->each(sub { shift->required(1) });

Each method as described in Input::Validator::Bulk. Added here for convenience.

    $field->inflate(sub { s/foo/bar/ });

Use this when you want to change value of field before validation.

    $field->multiple(1);

Field can have multiple values. Use this when you want to allow array reference as a value.

    $field->multiple(2, 5);

If you want to control how many multiple values there can be set "min" and "max" values.

    $field->multiple(10);

When "max" value is omitted and is not 1 (because it doesn't make sense), number of values must be equal to this value.

    $field->name('foo');
    my $name = $field->name;

Field's name.

    $field->required(1);

Whether field is required or not. See Input::Validator documentation what is an empty field.

    $field->trim(1);

Whether field's value should be trimmed before validation. It is ON by default.

Shortcut

    $field->constraint(callback => sub { ... });

    $field->clear_value;

Clears field's error.

    $field->clear_value;

Clears field's value.

    $field->constraint(length => [1, 2]);

Adds a new field's constraint.

    my $defined = $field->is_defined;

Checks whether field's value is defined.

    my $empty = $field->is_empty;

Checks whether field's value is empty.

Checks whether all field's constraints are valid.

Holds error message.

    my $value = $field->value;
    $field->value('foo')

Set or get field's value.

Input::Validator, Input::Validator::Constraint.
2011-10-27 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.