in reply to Re^3: Data structure / hash reference question
in thread Data structure / hash reference question
You were close with the first one - you just didn't need the dereferencing arrow ->. This should work:
$color = ${ ... }{color};
Why? Because if ... is a hashref, then %{...} is a plain old hash.
If our hash was called %foo then we'd access a value in it as $foo{color} - that is, change the sigil from % to $, and add the key in curlies. Our hash is called %{...} but we can still use the same technique.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Data structure / hash reference question
by stevieb (Canon) on Apr 22, 2012 at 13:10 UTC |