
Mojo::File::Memory - In-Memory File

use Mojo::File::Memory;
my $file = Mojo::File::Memory->new('Hello!');
$file->add_chunk('World!');
print $file->slurp;

Mojo::File::Memory is a container for in-memory files.

content my $handle = $file->content;
$file = $file->content('Hello World!');

Mojo::File::Memory inherits all methods from Mojo::File and implements the following new ones.
new my $file = Mojo::File::Memory->new('foo bar');
add_chunk $file = $file->add_chunk('test 123');
contains my $contains = $file->contains('random string');
copy_to $file = $file->copy_to('/foo/bar/baz.txt');
Copies the uploaded file contents to the given path and returns the invocant.
get_chunkmy $chunk = $file->get_chunk($offset);
lengthmy $length = $file->length;
move_to $file = $file->move_to('/foo/bar/baz.txt');
Moves the uploaded file contents to the given path and returns the invocant.
slurpmy $string = $file->slurp;