perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Piner <ste...@marketview.co.nz>
Subject Re: How do my handler call dynamically a module based the request input
Date Mon, 05 Aug 2002 22:43:50 GMT


Harry Zhu wrote:

[first question deleted]

> in module A::B, and if I do
> my %b = %{$A::B::c->{b}};
> and then even if I manipulate on %b, I found the $A::B::c also changed
> from other module calls.
> for example, if $t = $b{a}{a3}; it will added a key a3 to the hash
> %{A::B::c->{b}{a}} !
> 
> This probably due to the reference of $A::B::c->{b}. I know if,
> instead,
> my %b = (),
> foreach $b (keys %{$A::B::c->{b}}) {
>   foreach (keys %{$A::B::c->{b}{$b}}) {
>     $b{$b}{$_} = $A::B::c->{b}{$b}{$_};
>   }
> }
> 
> and it will not affact the $A::B::c what ever you do with the %b. Is
> the a simple way to copy only in values the hash of hash?
> 
> 
> Harry Zhu
> GreatLodge.com

perldoc -q 'How do I print out or copy a recursive data structure'

Hope this helps

-- 
Steve Piner
Web Applications Developer
Marketview Limited
http://www.marketview.co.nz

Mime
View raw message