Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ModPerl: Docs-dev

Syntax of UPLOAD function in Apache::TestRequest

 

 

ModPerl docs-dev RSS feed   Index | Next | Previous | View Threaded


william at knowmad

Jun 9, 2005, 11:00 AM

Post #1 of 2 (2018 views)
Permalink
Syntax of UPLOAD function in Apache::TestRequest

I've come across what I think is a syntax error in the documentation of
Apache::TestRequest which I'd like to get a second opinion on. Here's
how the POD says to use the function:

my $res = UPLOAD $uri, \@args, filename => $filename;

I've tried this but it did not work. I found that passing in an array
instead of an arrayref works. I tried to track where this value gets
set. It's calling prepare which then calls
Apache::TestConfig::filter_args. There's a bit too much indirection
going on for me to follow.

At any rate, I thought I'd pass this on for others who try to use this
code. BTW, I checked the tests and there were none in A::T which
exercised this function. I found a few in mod_perl but these were not
passing arguments so I wasn't able to confirm my experience.

I can make a doc patch and test if someone could confirm that prepare
is expecting an array rather than an arrayref.


Thanks,
William

--
Knowmad Services Inc.
http://www.knowmad.com

---------------------------------------------------------------------
To unsubscribe, e-mail: docs-dev-unsubscribe [at] perl
For additional commands, e-mail: docs-dev-help [at] perl


pgollucci at p6m7g8

Jun 9, 2005, 1:59 PM

Post #2 of 2 (1885 views)
Permalink
Re: Syntax of UPLOAD function in Apache::TestRequest [In reply to]

William McKee wrote:

>I've come across what I think is a syntax error in the documentation of
>Apache::TestRequest which I'd like to get a second opinion on. Here's
>how the POD says to use the function:
>
> my $res = UPLOAD $uri, \@args, filename => $filename;
>
>
$pass = \@args from above

sub UPLOAD {
my($url, $pass, $keep) = prepare(@_);

sub prepare {
my $url = shift;

........

### \@_ = [$pass, $keep] because of the shift
my($pass, $keep) = Apache::TestConfig::filter_args(\@_, \%wanted_args);


sub filter_args {
my($args, $wanted_args) = @_; ### $args = $pass or your \@args

my @filter = @$args;

## this might be killing you... whats a Data::Dumper::Dumper \@args
of your input args above
if (ref($filter[0])) {
push @pass, shift @filter;
}

hth


--

END
---------------------------------------------------------
What doesn't kill us, can only make us stronger.
Nothing is impossible.

Philip M. Gollucci (pgollucci [at] p6m7g8) 301.254.5198
Consultant / http://p6m7g8.net/Resume/resume.shtml
Senior Developer / Liquidity Services, Inc.
http://www.liquidityservicesinc.com


---------------------------------------------------------------------
To unsubscribe, e-mail: docs-dev-unsubscribe [at] perl
For additional commands, e-mail: docs-dev-help [at] perl

ModPerl docs-dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.