
Mojo::File - File

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

Mojo::File is a container for files.

cleanup my $cleanup = $file->cleanup;
$file = $file->cleanup(1);
handle my $handle = $file->handle;
$file = $file->handle(IO::File->new);
Returns a IO::File object representing a file upload if called without arguments. Returns the invocant if called with arguments.
path my $path = $file->path;
$file = $file->path('/foo/bar.txt');

Mojo::File inherits all methods from Mojo::Base and implements the following new ones.
new my $file = Mojo::File->new('Hello World!');
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;
Returns the entire file content as a string.