Locale::TextDomain::OO::Lexicon::Role::StoreFile - Role to store a lexicon as file
$Id: StoreFile.pm 573 2015-02-07 20:59:51Z steffenw $
$HeadURL: svn+ssh://steffenw@svn.code.sf.net/p/perl-gettext-oo/code/module/trunk/lib/Locale/TextDomain/OO/Lexicon/Role/StoreFile.pm $
1.017
This module contains methods that helps to store the lexicon as file.
Implements attributes "filename" and "file_handle".
with qw( Locale::TextDomain::OO::Lexicon::Role::StoreFile ); $self->store_content($content);
If "file_handle" is set the content will print;
If "filename" is set and not "file_handle" a file will be stored.
If both not set the content itself will be returned.
$content = $self->store_content($content);
$self->filename('myfile.myext') $self->store_content;
Set filename also to get a speaking error messages. Must not a real filename if the handle is not a real file.
my $filename = 'myfile.myext'; $self->filename($filename); open my $file_handle, q{>}, $filename or confess qq{Unable to open file "$filename" $OS_ERROR}; $self->file_handle($file_handle); $self->store_content; close $file_handle or confess qq{Unable to close file "$filename" $OS_ERROR};
Inside of this distribution is a directory named example. Run this *.pl files.
confess
none
Carp
English
Moo::Role
MooX::Types::MooseLike::Base
namespace::autoclean
not known
Locale::TextDoamin::OO
Steffen Winkler
Copyright (c) 2013 - 2015, Steffen Winkler <steffenw at cpan.org>. All rights reserved.
<steffenw at cpan.org>
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Locale::TextDomain::OO, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Locale::TextDomain::OO
CPAN shell
perl -MCPAN -e shell install Locale::TextDomain::OO
For more information on module installation, please visit the detailed CPAN module installation guide.