locked_user sundialsvc4 has asked for the wisdom of the Perl Monks concerning the following question:
(Former title was: “Plack::Request::Upload doesn’t have slurp.”)
First of all, my current install of Plack appears to be broken somehow, in the sense that I cannot use CPAN to install it without the following error:
'/usr/bin/perl Makefile.PL INSTALL_BASE=/Users/roswell/Sites/cpan_libr +aries INSTALLBIN=/usr/local/bin INSTALLSCRIPT=/usr/local/bin' returne +d status 2304, won't make
Secondly, I am getting an error:
Can't find object method "slurp" via "Plack::Request::Upload"
... which is particularly odd because I indeed do not see any such method in the code, nor on the version now on CPAN, does not contain that. (But where is the call coming from?) (See below.)
When I “Google It” ... I see other versions of Plack::Request::Upload, in other websites, which do contain a slurp method, and several other methods such as fh ... whereas the current definition on CPAN of Plack::Request::Online does not contain that method at all.
Exploring further ... more background info ...
The request object has the following Moose definition in it:
has plack_request => ( is => 'ro', isa => 'Plack::Request', lazy_build => 1, handles => { method => 'method', unparsed_uri => 'request_uri', uri => 'path', user => 'user', scheme => 'scheme', headers_in => 'headers', upload => 'upload', param => 'param', }, );
The code (which was designed originally for mod_perl’s request object) used the upload() method:
my $file = $i->{'q'}->upload('uploadFile');
then, a short time later:
my $io_len = $file->slurp( $slurp );
Hmmmm ...
I think I have two, unrelated issues here, and I Humbly Ask The Monks™ to see if you agree with my analysis:
Do you concur? Do you have recommendations or experiences as to how I should best deal with point #2?
In particular, the description of this module specifically refers to Catalyst::Request::Upload, as though the original intent was to be directly compatible with that. The Catalyst module continues to have the interface that my (legacy...) program expects. My educated guess is that it, in turn, was designed to mimic mod_perl. But at some point, Plack deviated.