Stas Bekman wrote:
because ap_location_walk is called twice during the request, the DIR_MERGE is called twice as well. The problem I have is that in the following code $base magically gets affected by the return value from DIR_MERGE.OK, Devel::Peek is a good friend and now I have it all sorted out. Since in my new test values of the base/add objects were references, copying a reference and then changing the array it was pointing to was obviously affecting the original object, which was getting wrong values when DIR_MERGE was called on the second time. That simple.
Consider:
sub DIR_MERGE {
my($base, $add) = @_;
use Data::Dumper;
warn Dumper $base, $add;
my %new = ();
#push @{ $new{$_} }, @{ $base->{$_} } for keys %$base;
# XXX: why this approach doesn't work?
@new{keys %$base} = (values %$base);
I'll document this issue.
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]