in reply to hash dereferencing / copying

For more complex datastructures, I like to use the perl-Module Storable to copy the content...

Best regards,
perl -le "s==*F=e=>y~\*martinF~stronat~=>s~[^\w]~~g=>chop,print"

Replies are listed 'Best First'.
Re: Re: hash dereferencing / copying
by PrakashK (Pilgrim) on Feb 27, 2002 at 15:34 UTC
    Or, Data::Dumper (it is slower than Storable though).
    use Data::Dumper; my $this = {a => 1, b => {bb => [ 'ccc' ]}, c => 3}; # clone $this into $that my $that = eval Data::Dumper::Dumper($a);
    /prakash