in reply to Undesirable parent hash keys
Do you really have an autovivification problem?
> I only want to be here if I set $Hash{'2013'}{'Oct'}{'11th'} = 1 explicitly.
If you only check if ($Hash{'2013'}{'Oct'}{'11th'} == 1) { .. } you can't be bothered by hash-refs.
Anyway better rethink your concept!
When setting $Hash{'2013'}{'Oct'}{'11th'} = 1 you are overwriting a potential hashref to a nested hash and any previous $Hash{'2013'}{'Oct'}{'11th'}{'1AM'}{'30Min'}=1 will be lost.
Better use an additional level of keys to mark and write and test $Hash{'2013'}{'Oct'}{'11th'}{MARK} or so.
Cheers Rolf
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Undesirable parent hash keys (concept?)
by sophate (Beadle) on Jan 11, 2013 at 09:26 UTC | |
by CountZero (Bishop) on Jan 11, 2013 at 10:25 UTC | |
by tobyink (Canon) on Jan 11, 2013 at 10:34 UTC |
In Section
Seekers of Perl Wisdom