projects
/
gitmo/MooseX-Storage.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
d8a209a91c514ebfb451e5a45784cfa5bd186fe2
[gitmo/MooseX-Storage.git]
/
lib
/
MooseX
/
Storage
/
Engine
/
IO
/
File.pm
1
2
package MooseX::Storage::IO::File;
3
use Moose;
4
5
use IO::File;
6
7
has file => (
8
isa => 'Str',
9
is => 'ro',
10
required => 1,
11
);
12
13
sub load {
14
my ($self) = @_;
15
my $fh = IO::File->new($self->file, 'r');
16
return do { local $/; <$fh>; };
17
}
18
19
sub store {
20
my ($self, $data) = @_;
21
my $fh = IO::File->new($self->file, 'w');
22
print $fh $data;
23
}