1 package MooseX::Storage::Engine::IO::File;
8 our $AUTHORITY = 'cpan:STEVAN';
18 my $fh = IO::File->new($self->file, 'r')
19 || confess "Unable to open file (" . $self->file . ") for loading : $!";
20 return do { local $/; <$fh>; };
24 my ($self, $data) = @_;
25 my $fh = IO::File->new($self->file, 'w')
26 || confess "Unable to open file (" . $self->file . ") for storing : $!";
27 $fh->binmode(':utf8') if utf8::is_utf8($data);
39 MooseX::Storage::Engine::IO::File - The actually file storage mechanism.
43 This provides the actual means to store data to a file.
53 =item B<store ($data)>
67 All complex software has bugs lurking in it, and this module is no
68 exception. If you find a bug please either email me, or add the bug
73 Chris Prather E<lt>chris.prather@iinteractive.comE<gt>
75 Stevan Little E<lt>stevan.little@iinteractive.comE<gt>
77 =head1 COPYRIGHT AND LICENSE
79 Copyright 2007-2008 by Infinity Interactive, Inc.
81 L<http://www.iinteractive.com>
83 This library is free software; you can redistribute it and/or modify
84 it under the same terms as Perl itself.