Brick::UserGuide - How to use Brick
Some one told you to use this module to validate data, and you need to know the shortest way to get that done. Someone else has created all the validation routines, or "bricks", already and you just have to use them.
Your validation description is the business rules that you want to apply to your input. It's just a list of anonymous arrays that tell Brick what to do (see Brick::Profile):
@Description = ( [ label => constraint_name => { setup hash } ], ... ); my $Brick = Brick->new(); my $profile = $Brick->profile_class->new( \@Description );
When you apply this profile, Brick does it's magic.
apply
my $result = $Brick->apply( $profile, \%Input );
Brick goes through the profile one anonymous array at a time, and in order. It validates one row of the anonymous array, saves the result, and moves on to the next anonymous array. At the end, you have the results in $result, which is a Brick::Results object.
$result
Brick::Results
That anonymous array's elements correspond item for item to the elements in the profile. The first element in $result goes with the first element in @Profile.
@Profile
Each element in $result is an anonymous array holding four items:
XXX: In progress
This source is in Github:
https://github.com/briandfoy/brick
brian d foy, <bdfoy@cpan.org>
<bdfoy@cpan.org>
Copyright © 2007-2018, brian d foy <bdfoy@cpan.org>. All rights reserved.
You may redistribute this under the terms of the Artistic License 2.0.
To install Brick, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Brick
CPAN shell
perl -MCPAN -e shell install Brick
For more information on module installation, please visit the detailed CPAN module installation guide.