Last active
December 22, 2015 16:09
-
-
Save johnmccabe/6497518 to your computer and use it in GitHub Desktop.
Breaking up hashes into lists based on values in the hash?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$hosts => { | |
'a.domain.com' => { | |
someparam => somevalue, | |
tags => [ 'red' ], | |
}, | |
'b.domain.com' => { | |
someparam => someothervalue, | |
tags => [ 'red', 'green' ], | |
}, | |
} | |
is there a way of getting lists out of the $hosts hash based on the tags array such that | |
redlist = ['a.domain.com', 'b.domain.com'] | |
greenlist = ['b.domain.com'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment