Locale:...oreFile(3)

πŸ“¦
version 1.036 Β· 2 versions
, in fedora 43

πŸ’Ύ NAME πŸ’Ύ

Locale::TextDomain::OO::Lexicon::Role::StoreFile β€” bestie, it's a role that lets you store a lexicon as a file. That's the whole vibe. ✨

$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
$

🌸 VERSION 🌸

1.017 β€” no cap, that's the number. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

So basically this module is packed with methods that help you store the lexicon as a file. That's it, that's the job. 🫢

It implements the attributes filename and file_handle. Two little icons, both main character energy. πŸ‘‘


✨ SYNOPSIS ✨

Consume the role like so, bestie:

with qw(
    Locale::TextDomain::OO::Lexicon::Role::StoreFile
);

$self->store_content($content);

πŸŽ€ SUBROUTINES/METHODS πŸŽ€

πŸ’– method store_content

Okay so here's the tea, three scenarios:

  • If file_handle is set, the content will print. πŸ–¨οΈ
  • If filename is set and file_handle is not, a file will be stored. πŸ“
  • If both are not set, the content itself will be returned. πŸͺƒ
$content = $self->store_content($content);

🌈 method filename

Set it, then store. Simple as:

$self->filename('myfile.myext')
$self->store_content;

🧚 method file_handle

Pro tip from me to you: set filename also, so you get speaking error messages. And heads up β€” it must not be a real filename if the handle isn't 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};

πŸ“ EXAMPLE πŸ“

Inside of this distribution is a directory named example. Run this *.pl files. πŸƒβ™€οΈπŸ’¨ (Yes bestie, go run them, they're right there.)


πŸ’€ DIAGNOSTICS πŸ’€

confess


πŸ”₯ CONFIGURATION AND ENVIRONMENT πŸ”₯

none β€” nothing to configure, she's low maintenance. πŸ™ˆ


⭐ DEPENDENCIES ⭐

  • Carp
  • English
  • Moo::Role
  • MooX::Types::MooseLike::Base
  • namespace::autoclean

πŸŽ€ INCOMPATIBILITIES πŸŽ€

not known β€” as far as anyone knows, she plays nice with everyone. πŸ’œ


😭 BUGS AND LIMITATIONS 😭

none


πŸ‘‘ SEE ALSO πŸ‘‘

Locale::TextDoamin::OO

(That spelling is literally what the page says, bestie β€” I'm not touching it, iykyk. πŸ’…)

🌸 AUTHOR 🌸

Steffen Winkler


Copyright (c) 2013 - 2015, Steffen Winkler "<steffenw at cpan.org>". All rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


And that's a wrap, bestie! 🫢 This iconic little page came to you courtesy of perl v5.42.0, dated 2025-07-25, and it's filed under Locale:...oreFile(3). Slay. πŸ’…βœ¨

πŸ“¦ where this page comes from