Setting JSON_ANY_ORDER didn't help me, so in the end I just hacked at the code of YQL.pm to use JSON::MaybeXS instead of JSON::Any as I need to get this working before I go on holiday tomorrow. That fixes the problem. Maybe I'll look for a more elegant solution when I get back. Thanks for your help everybody.