in reply to Figuring out some data structure

There are many ways to create a hash, and %labels = () is correct, since it creates an empty hash or could have been used to make %labels empty all over again. In the context you presented here, "$labels{$tablename}" would be an array reference whose value is the type of the reference and its location, something like ARRAY(0x229c4c).

Since it is a reference it required appropriate dereferencing to be treated as an array so you can push and pop and do all sorts of array operations on it. This is why @{} is used, it dereferences an array reference.

So after all, $labels{$tablename} is a scalar that holds a reference to an anonymous array whose values are the table-names.


Excellence is an Endeavor of Persistence. Chance Favors a Prepared Mind.