chiark / gitweb /
Remove automatic upgrade of numerical types
[nailing-cargo.git] / lib / TOML / Tiny / Util.pm
index 344b1b6549346140a29fa9e2fe03bc6e18afc765..b92c729d313d91997851c86aa7d353c3742857b8 100644 (file)
@@ -22,18 +22,20 @@ sub is_strict_array {
     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' };
         }
       }