Skip to content

Commit 3393d0a

Browse files
committed
Mention '0' is True in Perl 6 and common pattern is simperl
1 parent 7881a68 commit 3393d0a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

doc/Language/5to6-nutshell.pod

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1176,6 +1176,17 @@ system paths.
11761176
11771177
=head1 Misc.
11781178
1179+
=head2 C<'0'> is True
1180+
1181+
Unlike Perl 5, a string containing nothing but zero ('0') is C<True>. As Perl 6
1182+
has types in core, that makes more sense. This also means the common pattern:
1183+
1184+
... if defined $x and length $x; # or just length() in modern perls
1185+
1186+
In Perl 6 becomes a simple
1187+
1188+
... if $x;
1189+
11791190
=head2 C<dump>
11801191
11811192
Gone.

0 commit comments

Comments
 (0)