From: Jeff Ober Date: Fri, 17 Jan 2020 17:34:17 +0000 (-0500) Subject: Doc updates X-Git-Tag: nailing-cargo/1.0.0~234^2~21 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=13b6e165deba2f4e3a60c03ef008e3c6b9117a8f;p=nailing-cargo.git Doc updates --- diff --git a/README.pod b/README.pod index 58f45ce..2a49cd8 100644 --- a/README.pod +++ b/README.pod @@ -70,6 +70,13 @@ errors will result in returning two values, C and an error message. my ($result, $error) = from_toml($toml_string); +Homogenous array strictures are enabled by passing C: + + # Croaks + my $result = from_toml(q{mixed=[1, 2, "three"]}) + +Additional arguments may be passed after the toml source string; see L. + =head2 to_toml Encodes a hash ref as a C-formatted string. @@ -79,6 +86,11 @@ Encodes a hash ref as a C-formatted string. # [foo] # bar="bat" +Homogenous array strictures are enabled by passing C: + + # Croaks + my $toml = to_toml({mixed => [1, 2, "three"]}, strict_arrays => 1); + =head1 OBJECT API =head2 new diff --git a/lib/TOML/Tiny.pm b/lib/TOML/Tiny.pm index a2b8955..91595ec 100644 --- a/lib/TOML/Tiny.pm +++ b/lib/TOML/Tiny.pm @@ -126,6 +126,13 @@ errors will result in returning two values, C and an error message. my ($result, $error) = from_toml($toml_string); +Homogenous array strictures are enabled by passing C: + + # Croaks + my $result = from_toml(q{mixed=[1, 2, "three"]}) + +Additional arguments may be passed after the toml source string; see L. + =head2 to_toml Encodes a hash ref as a C-formatted string. @@ -135,6 +142,10 @@ Encodes a hash ref as a C-formatted string. # [foo] # bar="bat" +Homogenous array strictures are enabled by passing C: + + # Croaks + my $toml = to_toml({mixed => [1, 2, "three"]}, strict_arrays => 1); =head1 OBJECT API