p("{$_[0]}");
}
+sub json_convert_shim ($) {
+ my ($json) = @_;
+ # In JSON.pm 2.x, jsonToObj prints a warning to stderr which
+ # our callers don't like at all.
+ if ($JSON::VERSION >= 2) {
+ return from_json($json);
+ } else {
+ return jsonToObj($json);
+ }
+}
+
sub get_arches_islands () {
my $ocean= $ENV{'YPPSC_OCEAN'}; die unless $ocean;
my $url= "$pctb/islands.php?oceanName=".uc $ocean;
my $resp= $ua->get($url);
die $resp->status_line unless $resp->is_success;
$jsonresp= $resp->content;
- my $jobj= jsonToObj($resp->content);
+ my $jobj= json_convert_shim($resp->content);
my $arches= [ jparsetable($jobj, 'arches') ];
my $islands= [ jparsetable($jobj, 'islands') ];
return ($arches,$islands);