JSON::Validator::Error - JSON::Validator error object
use JSON::Validator::Error; my $err = JSON::Validator::Error->new($path, $message);
JSON::Validator::Error is a class representing validation errors from JSON::Validator.
my $str = $error->message;
A human readable description of the error. Defaults to empty string.
my $str = $error->path;
A JSON pointer to where the error occurred. Defaults to "/".
my $error = JSON::Validator::Error->new($path, $message);
Object constructor.
my $str = $error->to_string;
Returns the "path" and "message" part as a string: "$path: $message".
JSON::Validator::Error overloads the following operators:
my $bool = !!$error;
Always true.
my $str = "$error";
Alias for "to_string".
JSON::Validator.
To install JSON::Validator, copy and paste the appropriate command in to your terminal.
cpanm
cpanm JSON::Validator
CPAN shell
perl -MCPAN -e shell install JSON::Validator
For more information on module installation, please visit the detailed CPAN module installation guide.