my $type;
for (ref $value) {
- $type = 'array' when /ARRAY/;
- $type = 'table' when /HASH/;
- $type = 'float' when /Math::BigFloat/;
- $type = 'integer' when /Math::BigInt/;
- $type = 'bool' when /JSON::PP::Boolean/;
+ $type = 'array' when 'ARRAY';
+ $type = 'table' when 'HASH';
+
+ # Do a little heuristic guess-work
+ $type = 'float' when /Float/;
+ $type = 'integer' when /Int/;
+ $type = 'bool' when /Boolean/;
when ('') {
for ($value) {
- $type = 'bool' when /$Boolean/;
- $type = 'float' when /$Float/;
- $type = 'integer' when /$Integer/;
- $type = 'datetime' when /$DateTime/;
+ $type = 'bool' when /$Boolean/;
+ $type = 'float' when /$Float/;
+ $type = 'integer' when /$Integer/;
+ $type = 'datetime' when /$DateTime/;
default{ $type = 'string' };
}
}