Is it possible to safely access data in a nested data structure like Template Toolkit does?

Posted by wombat on Stack Overflow See other posts from Stack Overflow or by wombat
Published on 2010-06-17T00:15:35Z Indexed on 2010/06/17 0:22 UTC
Read the original article Hit count: 612

Filed under:

Is there a module that provides functionality like Template Toolkit does when accessing a deeply nested data structure? I want to pull out something like $a = $hash{first}[0]{second}{third}[3] without having to test each part of the structure to see if it conforms to what I expect. If %hash = {} I want $a = undef, not produce an error.

© Stack Overflow or respective owner

Related posts about perl