Subject: | Little bug and solution in the put method |
Date: | Wed, 18 Mar 2009 19:06:46 +0100 |
To: | bug-HTTP-DAV [...] rt.cpan.org |
From: | Oliver.Hoos [...] imperia.net |
Hi
in the current version of HTTP::DAV is a little bug in the put method.
######################################################################
sub put {
my ( $self, @p ) = @_;
my ( $local, $url, $callback )
= HTTP::DAV::Utils::rearrange( [ 'LOCAL', 'URL', 'CALLBACK' ], @p
);
$self->_start_multi_op( "put $local", $callback );
if ( ref($local) eq "SCALAR" ) {
$self->_put(@p);
}
else {
$local =~ s/\ /\\ /g;
my @globs = glob("$local");
If the $local is realy a SCALAR ref then the _start_multi_op output
returns a
scalar ref in the error message.
I changed my version into:
######################################################################
sub put {
my ( $self, @p ) = @_;
my ( $local, $url, $callback )
= HTTP::DAV::Utils::rearrange( [ 'LOCAL', 'URL', 'CALLBACK' ], @p
);
if ( ref($local) eq "SCALAR" ) {
$self->_start_multi_op( "put ".$$local, $callback );
$self->_put(@p);
}
else {
$self->_start_multi_op( "put $local", $callback );
$local =~ s/\ /\\ /g;
my @globs = glob("$local");
greetings
Oliver