package MooseX::Storage::Engine::IO::File;
use Moose;
-use IO::File;
-
has 'file' => (
is => 'ro',
isa => 'Str',
sub load {
my ($self) = @_;
+
+ require IO::File;
my $fh = IO::File->new($self->file, 'r')
|| confess "Unable to open file (" . $self->file . ") for loading : $!";
return do { local $/; <$fh>; };
sub store {
my ($self, $data) = @_;
+
+ require IO::File;
my $fh = IO::File->new($self->file, 'w')
|| confess "Unable to open file (" . $self->file . ") for storing : $!";
$fh->binmode(':utf8') if utf8::is_utf8($data);