in reply to Method autovivification with variable values?

Ummm...
unless (exists $configs{image}{attach}{$text_to_check}) { # Do stuff here with $text_to_check }
Is that what you're looking for?

------
We are the carpenters and bricklayers of the Information Age.

Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

Replies are listed 'Best First'.
Re: Re: Method autovivification with variable values?
by tame1 (Pilgrim) on Sep 28, 2001 at 20:44 UTC
    'Fraid not. That would have to be done at the interface level, which would end up requiring said tests to be written into a dozen modules. I'm hoping for something which can be written into the same module as the $configs is defined, and thus can be used w/o editing the interface layer.

    Thanks for the try!

    What does this little button do . .<Click>; "USER HAS SIGNED OFF FOR THE DAY"
      You can do a tie to $configs, so that whenever a FETCH is done, it checks for existence and auto-vivifies before returning the value.

      ------
      We are the carpenters and bricklayers of the Information Age.

      Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

        But will it automatically give it a value that depends upon the variable it was called with?

        What does this little button do . .<Click>; "USER HAS SIGNED OFF FOR THE DAY"