Skip to content

Commit c1ef617

Browse files
committed
Replace #=> with #->
1 parent ea1a253 commit c1ef617

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

lib/Language/traps.pod

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -164,59 +164,59 @@ array. This is why the number of elements will turn out to be 1 instead of
164164
zero as might be expected by the unwary.
165165
166166
my @array = []; # assigns empty array as an item in @array
167-
say @array.elems; #=> 1
167+
say @array.elems; #-> 1
168168
169169
Whereas querying the number of elements of the empty array directly returns
170170
zero as expected:
171171
172-
say [].elems; #=> 0
172+
say [].elems; #-> 0
173173
174174
This can be more clearly seen by calling the C<.perl> method on the object:
175175
176176
my @array = [];
177-
say @array.perl; #=> Array.new([]) # an array containing an empty array
177+
say @array.perl; #-> Array.new([]) # an array containing an empty array
178178
179179
in contrast to:
180180
181181
my @array = ();
182-
say @array.perl; #=> Array.new() # a truly empty array
182+
say @array.perl; #-> Array.new() # a truly empty array
183183
184184
Note that this is I<also> the behaviour in Perl 5:
185185
186-
perl -E "say scalar(my @array = [])" #=> 1
187-
perl -E "say scalar(my @array = ())" #=> 0
186+
perl -E "say scalar(my @array = [])" #-> 1
187+
perl -E "say scalar(my @array = ())" #-> 0
188188
189189
=head2 Referencing the last element of an array
190190
191191
In Perl 5 one could reference the last element of an array by asking for the
192192
"-1th" element of the array, e.g.:
193193
194194
my @array = qw{victor alice bob charlie eve};
195-
say @array[-1]; #=> eve
195+
say @array[-1]; #-> eve
196196
197197
In Perl 6 it is not possible to use negative subscripts, however the same is
198198
achieved by actually using a function, namely C<*-1>. Thus accessing the
199199
last element of an array becomes:
200200
201201
my @array = qw{victor alice bob charlie eve};
202-
say @array[*-1]; #=> eve
202+
say @array[*-1]; #-> eve
203203
204204
=head1 Strings
205205
206206
=head2 Capitalizing a string
207207
208208
In Perl 5 one could capitalize a string by using the C<ucfirst> function
209209
210-
say ucfirst "alice"; #=> Alice
210+
say ucfirst "alice"; #-> Alice
211211
212212
The C<ucfirst> function does not exist in Perl 6; one needs to use the
213213
C<tc> method:
214214
215-
say "alice".tc; #=> Alice
215+
say "alice".tc; #-> Alice
216216
217217
which is equivalent to
218218
219-
say tc "alice"; #=> Alice
219+
say tc "alice"; #-> Alice
220220
221221
Here, C<tc> means "title case".
222222

0 commit comments

Comments
 (0)