* Cameron Kaiser <[email protected]> [101109 20:41]:
> If you are on a Perl that does not have 64-bit int and you are not using
> the stringified *_str fields, you may have overflowed the Perl precision
> limit this morning, which bit TTYtter users hard. Just a friendly warning
> to check your code, or use BigInt if you can rely on that support.
Cameron, I'm not experiencing any problems in Net::Twitter applications.
As long as "id". All of JSON::Any backends (JSON::XS, typically) result
in a value that maintains its full precision as long as it's used in a
string context. Am I missing something that's going to bite me (and
therefore Net::Twitter users in general)?
If you're treating it purely as a string, no (but I don't know how JSON::*
handles things that appear to be integer values, and "id" is not stringified
itself in the raw JSON).
perl -MJSON::XS=decode_json -E \
'$r=decode_json q({"id":9876543210123456789}); say $r->{id}'
# 9876543210123456789
Using Devel::Peek, the decoded 19 digit number is represented as a
string, internally, by perl:
SV = PV(0x9e98280) at 0x9e3d678
REFCNT = 1
FLAGS = (POK,pPOK)
PV = 0x9c9c0a8 "9876543210123456789"\0
CUR = 19
LEN = 20
So, I think as long as perl apps only use the new, longer IDs in string
context, they should be ok. I've tested some typical scenarios using
each of the JSON::Any backends, storing and retrieving to a MySQL BIGINT
field, etc.
It may very well be safer to use the id_str values---certainly more
explicit. But I haven't found common usage that will fail with the new,
longer IDs.
-Marc
--
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group:
http://groups.google.com/group/twitter-development-talk