#!/usr/bin/perl -- use strict; use warnings; use Data::Dumper; my %one = ( a => { b => { c => { d => { 6 } } } } ); print Dumper( \%one, $one{a}{b}{c} ); my $none = $one{a}{b}{c} ; for my $k( keys %$none ){ $none->{"$k$k"} = "$k$k"; } print Dumper( \%one); __END__ $VAR1 = { 'a' => { 'b' => { 'c' => { 'd' => { '6' => undef } } } } }; $VAR2 = $VAR1->{'a'}{'b'}{'c'}; $VAR1 = { 'a' => { 'b' => { 'c' => { 'dd' => 'dd', 'd' => { '6' => undef } } } } };
In reply to Re: Using foreach on a hash passed to a subroutine
by Anonymous Monk
in thread Using foreach on a hash passed to a subroutine
by carcassonne
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |