How to get rid of this badarg error

Wed Sep 21 20:29:57 CEST 2005

I have some code as follows:

1    {CookieInt, _} = string:to_integer(CookieStr),
 2   io:format("[CookieInt] = ~p~n", [CookieInt]),
  3  [CacheEntry] = ets:lookup(aaa_cache,CookieInt),

where CookieInt is printed as 15063539827397697793
I get an error at Line 3 as follows

Unrecognised error:

Where as when I type [CacheEntry] =
ets:lookup(aaa_cache, 15063539827397697793).
at the erlang shell it fetches the record correctly
from the aaa_cache table, where
15063539827397697793 is the key.

So what is CookieInt at line 1. Is it an atom or
variable. I supposed it was a variable and hence used
it line 3. But I do not understand why it does not

Any suggestions or comments to get out of this

PS; the CookieStr in line 1 was derived from these
code. I think, these may not be relevant to the

A=  binary_to_list(Cookie),
               io:format("[A] = ~p~n", [A]),     % A
is printed as ed5f793776732.15063539827397697793
               Index = string:chr(A,$.),
               CookieStr = string:substr(A, Index+1),

Yahoo! Mail - PC Magazine Editors' Choice 2005

More information about the erlang-questions mailing list