Skip to content

Commit e2cb057

Browse files
committed
Enahnce the 'Conditional Operator' section.
Added a simple example based on the previous one that shows side-to-side the difference between the Perl 5 and Perl 6 ?: and ??!!. Added a space in C<? :> for coherence with the C<?? !!>.
1 parent c3de498 commit e2cb057

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

doc/Language/5to6-perlop.pod6

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,15 @@ documented at this time.
179179
180180
=head2 Conditional Operator
181181
182-
C<?:> has been replaced by C<?? !!>. I. e. where you would use C<$x
183-
= $ok ? $y : $z;> in Perl 5, you would use C<$x = $ok ?? $y !! $z;>
184-
in Perl 6.
182+
The conditional operator C<? :> has been replaced
183+
by C<?? !!>:
184+
185+
=begin code
186+
$x = $ok ? $yes : $no; # Perl 5
187+
188+
$x = $ok ?? $yes !! $no; # Perl 6
189+
=end code
190+
185191
186192
=head2 Assignment Operators
187193

0 commit comments

Comments
 (0)