in reply to Re: getting array value from anonymous hash
in thread getting array value from anonymous hash
Thanks that helped. However am confused with the following code
{ (keys %$_)[0] }my @hosts = map { (keys %$_)[0] } @{ $hashref->{Inventory}{host} };
can be replaced simply with
{ keys %$_ }I am not sure what
$_)[0]actually does
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: getting array value from anonymous hash
by Athanasius (Archbishop) on Feb 14, 2014 at 09:34 UTC |