X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FRequest%2FUpload.pm;h=d8e58bea7e0f7834b39ad0b9048d648b482d1e52;hb=d0cacee71a316290bc01f0e12681c16bdc1e84e2;hp=1427bcb1852198e658e4911e6ea22e35a6dffde5;hpb=554c758740d1f5b5b548b777e7180e556f9f6a55;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Request/Upload.pm b/lib/Catalyst/Request/Upload.pm index 1427bcb..d8e58be 100644 --- a/lib/Catalyst/Request/Upload.pm +++ b/lib/Catalyst/Request/Upload.pm @@ -5,7 +5,7 @@ with 'MooseX::Emulate::Class::Accessor::Fast'; use Catalyst::Exception; use File::Copy (); -use IO::File qw( SEEK_SET ); +use IO::File (); use File::Spec::Unix; use namespace::clean -except => 'meta'; @@ -45,6 +45,8 @@ sub _build_basename { no Moose; +=for stopwords uploadtmp + =head1 NAME Catalyst::Request::Upload - handles file upload requests @@ -129,9 +131,9 @@ Returns the size of the uploaded file in bytes. Returns a scalar containing the contents of the temporary file. -Note that this method will cause the filehandle pointed to by -C<< $upload->fh >> to be seeked to the start of the file, -and the file handle to be put into binary mode. +Note that this will cause the filehandle pointed to by C<< $upload->fh >> to +be reset to the start of the file using seek and the file handle to be put +into binary mode. =cut @@ -147,12 +149,12 @@ sub slurp { binmode( $handle, $layer ); - $handle->seek(0, SEEK_SET); + $handle->seek(0, IO::File::SEEK_SET); while ( $handle->sysread( my $buffer, 8192 ) ) { $content .= $buffer; } - $handle->seek(0, SEEK_SET); + $handle->seek(0, IO::File::SEEK_SET); return $content; }