<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:16px"><div id="yiv2761562137"><div id="yui_3_16_0_1_1427732725239_2340"><div id="yiv2761562137yui_3_16_0_1_1427730119921_2188" style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; background-color: rgb(255, 255, 255);" dir="ltr">Houston PMs,</div><div id="yiv2761562137yui_3_16_0_1_1427730119921_2289" style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; background-color: rgb(255, 255, 255);" dir="ltr">I have a catch 22 that I cannot figure out.  I need both JSON::PP (for sort_by capability on encoding) and JSON::XS (for performance on decoding).  We are moving from EL5 to EL6 but the JSON libs are not really consistent between the environments.  Has anyone else worked through this fiasco and have any best practices on how to get past this?</div><div id="yiv2761562137yui_3_16_0_1_1427730119921_2384" style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; background-color: rgb(255, 255, 255);" dir="ltr">Thanks,</div><div id="yui_3_16_0_1_1427732725239_2395" style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; background-color: rgb(255, 255, 255);" dir="ltr">Mike</div><div id="yiv2761562137yui_3_16_0_1_1427730119921_2333" style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; background-color: rgb(255, 255, 255);" dir="ltr"> </div><div id="yiv2761562137yui_3_16_0_1_1427730119921_2362" style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; background-color: rgb(255, 255, 255);" dir="ltr">#use JSON perl version for sort_by for interoperability with crappy Windows service</div><div id="yiv2761562137yui_3_16_0_1_1427730119921_2332" style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; background-color: rgb(255, 255, 255);" dir="ltr">$self->json->sort_by(sub {no warnings q{uninitialized};$sorter->{$JSON::PP::a} <=> $sorter->{$JSON::PP::b}});</div><div id="yiv2761562137yui_3_16_0_1_1427730119921_2331" style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; background-color: rgb(255, 255, 255);" dir="ltr">$self->json->encode($data_input);</div><div id="yiv2761562137yui_3_16_0_1_1427730119921_2345" style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; background-color: rgb(255, 255, 255);" dir="ltr"> </div><div id="yiv2761562137yui_3_16_0_1_1427730119921_2362" style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; background-color: rgb(255, 255, 255);" dir="ltr">#use JSON:XS version for performance with VERY large returns</div><div id="yiv2761562137yui_3_16_0_1_1427730119921_2370" style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; background-color: rgb(255, 255, 255);" dir="ltr">return $self->jsonxs->decode($json_return);</div><div id="yiv2761562137yui_3_16_0_1_1427730119921_2438" style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; background-color: rgb(255, 255, 255);" dir="ltr"> </div><div id="yiv2761562137yui_3_16_0_1_1427730119921_2448" style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; background-color: rgb(255, 255, 255);" dir="ltr">So, it looks like I need to do something like this.</div><div id="yiv2761562137yui_3_16_0_1_1427730119921_2449" style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; background-color: rgb(255, 255, 255);" dir="ltr"> </div><div id="yiv2761562137yui_3_16_0_1_1427730119921_2450" style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; background-color: rgb(255, 255, 255);" dir="ltr">if ('some logic to figure out running on EL5 vs EL6 like load JSON and see if JSON->can("sort_by")') {</div><div id="yiv2761562137yui_3_16_0_1_1427730119921_2451" style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; background-color: rgb(255, 255, 255);" dir="ltr">use JSON::PP qw{}; #we require JSON::PP->sort_by<br>} else {</div><div id="yiv2761562137yui_3_16_0_1_1427730119921_2480" style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; background-color: rgb(255, 255, 255);" dir="ltr">use JSON qw{}; #we require JSON::PP->sort_by<br>}</div><div id="yui_3_16_0_1_1427732725239_2438" style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; background-color: rgb(255, 255, 255);" dir="ltr"> </div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; background-color: rgb(255, 255, 255);" dir="ltr">mrdvt92</div></div></div></div></body></html>