this works well. but because you can do it in perl in so many ways, i look forward to learn how to make it more elegant with map and grep. is there a tutorial to learn how to translate this 'foreach / if' combination into 'map / grep'? how would you translate this? thanks.foreach $hk (keys %$hash) { foreach $m (@{$hash->{$hk}->{member}}) { if($m eq $search) { print "$hk\n"; } } }
In reply to howto map/grep a complex structure by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |