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. | [reply] |
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"
| [reply] [d/l] |
What do you mean by "the variable it was called with"? Either $configs is a hashref or it's an object. If it's a hashref, you can tie it. If it's an object, you should be controlling the accesses into the data using some set of methods. In fact, all tie does is give you the same control over access you have with objects and let you use that control with "normal" variable types like scalars and hashes.
------ 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.
| [reply] |