DAIA::Message - An optional information or error message
version 0.43
Messages can occurr as property of DAIA::Response, DAIA::Document, DAIA::Item, and DAIA::Availability objects.
The message as plain Unicode string. The default value is the empty string.
A mandatory RFC 3066 language code. The default value is defined in $DAIA::Message::DEFAULT_LANG and set to 'en'.
$DAIA::Message::DEFAULT_LANG
'en'
By default this property is set to undef. You can set it to any integer for error messages.
undef
The message function is a shortcut for the DAIA::Message constructor:
message
$msg = DAIA::Message->new( ... ); $msg = message( ... );
The constructor understands several abbreviated ways to define a message:
$msg = message( $content [, lang => $lang ] ) $msg = message( $lang => $content ) $msg = message( $lang => $content )
To set or get all messages of an object, you use the messages accessor. You can pass an array reference or an array:
messages
$messages = $document->message; # returns an array reference $document->message( [ $msg1, $msg2 ] ); $document->message( [ $msg ] ); $document->message( $msg1, $msg2); $document->message( $msg );
To append a message you can use the add or the addMessage method:
add
addMessage
$document->add( $msg ); # $msg must be a DAIA::Message $document->addMessage( ... ); # ... is passed to message constructor
Returns whether $tag is a formally valid language tag. The regular expression follows XML Schema type xs:language instead of RFC 3066. For true RFC 3066 support have a look at I18N::LangTags.
xs:language
Jakob Voß
This software is copyright (c) 2013 by Jakob Voß.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install DAIA, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DAIA
CPAN shell
perl -MCPAN -e shell install DAIA
For more information on module installation, please visit the detailed CPAN module installation guide.