in reply to Getting a parent of a sub (array|hash) in a complex variable

> Is there a perl's built-in way to get a reference of the parent,

No these data structures hold only references (only a "is_child" relation if you want), and like choroba already pointed out many "parents" can have the same "child".

> Or the only ways to do it is iteratively search an entire complex variable or indexing it and searching the index?

Many more possibilities:

The best strategy depends on the details (which we don't know). Most probably you just need to redesign your data.

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Wikisyntax for the Monastery