Data::Text::Simple - Data object for text in language.
use Data::Text::Simple; my $obj = Data::Text::Simple->new(%params); my $id = $obj->id; my $lang = $obj->lang; my $text = $obj->text;
new
my $obj = Data::Text::Simple->new(%params);
Constructor.
id
Id of record. Id could be number.
It's optional.
Default value is undef.
lang
Language ISO 639-1 code.
text
Main text.
It's required.
Returns instance of object.
my $id = $obj->id;
Get id.
Returns number.
my $lang = $obj->lang;
Get language ISO 639-1 code.
Returns string.
my $text = $obj->text;
Get text.
new(): From Mo::utils: Parameter 'id' must be a number. Value: %s Parameter 'text' is required. From Mo::utils::Language: Parameter 'lang' doesn't contain valid ISO 639-1 code. Codeset: %s Value: %s
use strict; use warnings; use Data::Text::Simple; my $obj = Data::Text::Simple->new( 'id' => 7, 'lang' => 'en', 'text' => 'This is a text.', ); # Print out. print 'Id: '.$obj->id."\n"; print 'Language: '.$obj->lang."\n"; print 'Text: '.$obj->text."\n"; # Output: # Id: 7 # Language: en # Text: This is a text.
Mo, Mo::utils, Mo::utils::Language.
https://github.com/michal-josef-spacek/Data-Text-Simple
Michal Josef Špaček mailto:skim@cpan.org
http://skim.cz
© 2023-2024 Michal Josef Špaček
BSD 2-Clause License
0.02
To install Data::Text::Simple, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Text::Simple
CPAN shell
perl -MCPAN -e shell install Data::Text::Simple
For more information on module installation, please visit the detailed CPAN module installation guide.