[erlang-questions] How to match on a nested record against a dict

Jarrod Roberson jarrod@REDACTED
Tue Nov 24 22:25:57 CET 2009

On Tue, Nov 24, 2009 at 3:18 PM, Jarrod Roberson <jarrod@REDACTED>wrote:

> process_dnsrec1(Sub,[#dns_rr{domain=Dom}|Rest]) ->
>   case dict:find(Dom,Sub) of
>       [Result] ->
>           io:format("Interesting domain ~p=~p~n",[Dom,Result]);

thanks for reading I figured it out by trial and error.
I replaced the [Result] with {ok,Result} and it started working as expected

More information about the erlang-questions mailing list