Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Applied edits from Andrew Grangaard.

  • Loading branch information...
commit 29f70249fdcd81d5973b17024a1c9e8f647644b7 1 parent 87da6f2
@chromatic authored
View
3  CREDITS
@@ -194,3 +194,6 @@ E: rlhicks@wehicks.com
N: Chris Niswander
E: cnp1@chrisniswander.com
+
+N: Andrew Grangaard
+E: spazm@cpan.org
View
5 sections/coercion.pod
@@ -23,8 +23,9 @@ X<truthiness>
Boolean coercion occurs when you test the I<truthiness> of a valueN<Truthiness
is like truthfulness if you squint and say "Yeah, that's true, but....">, such
as in a C<if> or C<while> condition. Numeric 0 is false. The undefined value
-is false. The empty string is false, and so is the string C<'0'>. The strings
-C<'0.0'> and C<'0e'> are I<true>, however.
+is false. The empty string is false, and so is the string C<'0'>. Strings
+which may be I<numerically> equal to zero (such as C<'0.0'>, C<'0e'>, and C<'0
+but true'>) are I<true>, however.
All other values are true, including the idiomatic string C<'0 but true'>. In
the case of a scalar with both string and numeric portions (L<dualvars>), Perl
View
14 sections/control_flow.pod
@@ -261,7 +261,8 @@ select between alternative I<variables>, not only values:
=begin programlisting
- push @{ rand() > 0.5 ? \@red_team : \@blue_team }, Player->new();
+ push @{ rand() > 0.5 ? \@red_team : \@blue_team },
+ Player->new();
=end programlisting
@@ -381,11 +382,12 @@ Empty hashes and arrays evaluate to false.
Perl 5 has no single true value, nor a single false value. Any number that
evaluates to 0 is false. This includes C<0>, C<0.0>, C<0e0>, C<0x0>, and so
-on. The empty string (C<''>) and C<"0"> evaluate to false, but the strings
-C<"0.0">, C<"0e0">, and so on do not. The idiom C<"0 but true"> evaluates to 0
-in numeric context but evaluates to true, thanks to its string contents. Both
-the empty list and C<undef> evaluate to false. Empty arrays and hashes return
-the number 0 in scalar context, so they evaluate to false in boolean context.
+on. The empty string (C<''>) and C<'0'> evaluate to false, but the strings
+C<'0.0'>, C<'0e0'>, and so on do not. The idiom C<'0 but true'> evaluates to 0
+in numeric context but evaluates to true in boolean context, thanks to its
+string contents. Both the empty list and C<undef> evaluate to false. Empty
+arrays and hashes return the number 0 in scalar context, so they evaluate to
+false in boolean context.
An array which contains a single element--even C<undef>--evaluates to true in
boolean context. A hash which contains any elements--even a key and a value of
View
2  sections/names.pod
@@ -20,7 +20,7 @@ identifiers. These are all valid Perl identifiers:
sub anAwkwardName3;
- # with C<use utf8;> enabled
+ # with use utf8; enabled
package Ingy::DE<ouml>t::Net;
=end programlisting
View
6 sections/references.pod
@@ -230,7 +230,7 @@ Surround a list of values or expressions with square brackets:
=end programlisting
This array reference behaves the same as named array references, except that
-anonymous array references I<always> create a new reference, while taking a
+the anonymous array brackets I<always> create a new reference, while taking a
reference to a named array always refers to the I<same> array with regard to
scoping. That is to say:
@@ -257,8 +257,8 @@ scoping. That is to say:
=end programlisting
... neither C<$sunday_ref> nor C<$monday_ref> contains a dessert. Within the
-square braces used to create the anonymous array reference, the C<@meals> array
-flattens in list context.
+square braces used to create the anonymous array, the C<@meals> array flattens
+in list context.
=head3 Hash References
Please sign in to comment.
Something went wrong with that request. Please try again.