Query: validation::class::errors
OS: debian
Section: 3pm
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
Validation::Class::Errors(3pm) User Contributed Perl Documentation Validation::Class::Errors(3pm)NAMEValidation::Class::Errors - Error Handling Object for Fields and ClassesVERSIONversion 7.70SYNOPSISpackage SomeClass; use Validation::Class; package main; my $class = SomeClass->new; ... # errors at the class-level my $errors = $class->errors ; print $errors->to_string; # errors at the field-level my $field_errors = $user->fields->{name}->{errors} ; print $field_errors->to_string; 1;DESCRIPTIONValidation::Class::Errors is responsible for error handling in Validation::Class derived classes on both the class and field levels respectively.METHODSnew my $self = Validation::Class::Errors->new; add $self = $self->add("houston, we have a problem", "this isn't cool"); all my @list = $self->all; clear $self = $self->clear; count my $count = $self->count; each my $list = $self->each(sub{ ucfirst lc shift }); list my $list = $self->list; find my @matches = $self->find(qr/password/); first my $item = $self->first; my $item = $self->first(qr/password/); join my $string = $self->join; # returns "an error, another error" my $string = $self->join($delimiter); to_string The to_string method stringifies the errors using the specified delimiter or ", " (comma-space) by default. my $string = $self->to_string; # returns "an error, another error" my $string = $self->to_string($delimiter, sub { ucfirst lc shift });AUTHORAl Newkirk <anewkirk@ana.io>COPYRIGHT AND LICENSEThis software is copyright (c) 2011 by Al Newkirk. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.14.2 2012-06-28 Validation::Class::Errors(3pm)
Similar Topics in the Unix Linux Community |
---|
Perl Regular Expression - Whitelist |
0509-136 Errors with nmon TL8 |
Validation of variable |
Determine the string is valid |
[Beginner's questions] Filename Validation & Parsing |