use Data::Float qw/float_is_infinite float_is_nan/;
use Scalar::Util qw/looks_like_number/;
use JSON;
use Switch;
our @EXPORT_OK = qw(convert get_units);
our $VERSION = '0.0322';
our $DE
'NO_DATA_FILE' ) {
$units = encode_json( old_get_units() );
}
else {
$units = read_file($data_file);
}
return decode_json($units);
}
# does it make sense to return
tly only supports JSON) - then you will be able to use C::P as a service. See examples/service.pl
for an example Dancer2 script. See data/units.json for an example of a valid json data set.
See t