chiark / gitweb /
Doc updates
authorJeff Ober <jober@ziprecruiter.com>
Fri, 17 Jan 2020 17:34:17 +0000 (12:34 -0500)
committerJeff Ober <jober@ziprecruiter.com>
Fri, 17 Jan 2020 17:34:17 +0000 (12:34 -0500)
README.pod
lib/TOML/Tiny.pm

index 58f45cee9bec14a826b9368b468304ab1f312a20..2a49cd8806d78f58e11a1a1fbde6271271a56258 100644 (file)
@@ -70,6 +70,13 @@ errors will result in returning two values, C<undef> and an error message.
 
   my ($result, $error) = from_toml($toml_string);
 
+Homogenous array strictures are enabled by passing C<strict_arrays>:
+
+  # Croaks
+  my $result = from_toml(q{mixed=[1, 2, "three"]})
+
+Additional arguments may be passed after the toml source string; see L</new>.
+
 =head2 to_toml
 
 Encodes a hash ref as a C<TOML>-formatted string.
@@ -79,6 +86,11 @@ Encodes a hash ref as a C<TOML>-formatted string.
   # [foo]
   # bar="bat"
 
+Homogenous array strictures are enabled by passing C<strict_arrays>:
+
+  # Croaks
+  my $toml = to_toml({mixed => [1, 2, "three"]}, strict_arrays => 1);
+
 =head1 OBJECT API
 
 =head2 new
index a2b89553461246134ceca00564c628e6d868836c..91595ec60329c7193e832cf4f5097885131d1d11 100644 (file)
@@ -126,6 +126,13 @@ errors will result in returning two values, C<undef> and an error message.
 
   my ($result, $error) = from_toml($toml_string);
 
+Homogenous array strictures are enabled by passing C<strict_arrays>:
+
+  # Croaks
+  my $result = from_toml(q{mixed=[1, 2, "three"]})
+
+Additional arguments may be passed after the toml source string; see L</new>.
+
 =head2 to_toml
 
 Encodes a hash ref as a C<TOML>-formatted string.
@@ -135,6 +142,10 @@ Encodes a hash ref as a C<TOML>-formatted string.
   # [foo]
   # bar="bat"
 
+Homogenous array strictures are enabled by passing C<strict_arrays>:
+
+  # Croaks
+  my $toml = to_toml({mixed => [1, 2, "three"]}, strict_arrays => 1);
 
 =head1 OBJECT API