in reply to Defining a hash key for later use

So what you want to do is just create an element? and set it's value to undef?

Then you could simply do $page->{....}{'toolbar'}; then the key will be created...

Replies are listed 'Best First'.
Re^2: Defining a hash key for later use
by amw1 (Friar) on Feb 01, 2005 at 16:51 UTC
    I've also just tried to set:
    $page->{...}{'toolbar'}{'standard'} = $toolbar->{'standard'};
    before $toolbar->{'standard'} gets defined but it doesn't appear to work. I was expecting it to work as well.

    I may have misstated a detail on the problem. The structure lays out a little more like this:

    # $struct->{'toolbar'}{'standard'} does not exist at # this point. $struct->{'toolbar'} may or may not exist $struct->{'page'}{...}{'toolbar'}{'standard'} = $struct->{'toolbar'}{' +standard'};

    This is more complete.