MooseX...micFile(3pm)

πŸ“¦
version 0.53 Β· 5 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’… NAME πŸ’…

MooseX::Storage::IO::AtomicFile β€” bestie, it's literally An Atomic File I/O role ✨


πŸŽ€ VERSION πŸŽ€

version 0.53 🫢


πŸ¦‹ SYNOPSIS πŸ¦‹

okay so picture this: you got a Point class and you want it to save itself to disk without any messy half-written chaos. here's the entire vibe:

package Point;
use Moose;
use MooseX::Storage;

with Storage('format' => 'JSON', 'io' => 'AtomicFile');

has 'x' => (is => 'rw', isa => 'Int');
has 'y' => (is => 'rw', isa => 'Int');

1;

my $p = Point->new(x => 10, y => 10);

## methods to load/store a class
## on the file system

$p->store('my_point.json');

my $p2 = Point->load('my_point.json');

like yes, that's it, that's the whole thing, store it and load it and go live your life πŸ’–


🌸 METHODS 🌸

  • load ($filename) β€” bestie reads it back in from $filename ⭐
  • store ($filename) β€” bestie writes it out to $filename πŸ”₯

πŸ’œ SUPPORT πŸ’œ

ngl if you find a bug (and you might 😭), you can submit it through the RT bug tracker: https://rt.cpan.org/Public/Dist/Display.html?Name=MooseX-Storage β€” or if email is more your thing, hit up bug-MooseX-Storage@rt.cpan.org βœ‰οΈ

there's also a mailing list for users of this distribution, over at http://lists.perl.org/list/moose.html 🫢

and there's an irc channel for users of this distribution too β€” it's #moose on irc.perl.org (that's irc://irc.perl.org/#moose if you're fancy) πŸ’¬


πŸ‘‘ AUTHORS πŸ‘‘

the literal icons who made this:

  • Chris Prather <chris.prather@iinteractive.com>
  • Stevan Little <stevan.little@iinteractive.com>
  • Χ™Χ•Χ‘Χœ Χ§Χ•Χ’'מן (Yuval Kogman) <nothingmuch@woobling.org>

This software is copyright (c) 2007 by Infinity Interactive, Inc. πŸ“œ

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. periodt πŸ’…


no cap, that's the whole page.

okay bestie that's a wrap β€” this was MooseX::Storage::IO::AtomicFile from the User Contributed Perl Documentation, running on perl v5.36.0, dated 2022-10-16. go forth and be atomic βœ¨πŸ¦‹πŸ’–

πŸ“¦ where this page comes from