File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -273,7 +273,7 @@ default constructor, the attribute C<@!travelers> is not initialized.
273273
274274=head2 Traits
275275
276- Several Traits are provided to modify the behavior of attributes.
276+ Several traits are provided to modify the behavior of attributes.
277277Attribute traits are introduced by the C<is> keyword after the attribute name.
278278The following traits (and some others) are documented L<here|/type/Attribute#Traits>.
279279
@@ -300,15 +300,15 @@ Here's how to construct and use this new version of Journey:
300300# Create a new instance of the class.
301301my $vacation = Journey.new(
302302 origin => 'Sweden',
303- status => 'Requested',
303+ status => 'Requested'
304304);
305305
306306# Use a setter accessor on a read/write attribute, then a getter to read it,
307- then assign Nil to reset the default.
307+ # then assign Nil to reset the default.
308308$vacation.destination = 'San Francisco';
309- say $vacation.destination; #OUTPUT San Francisco
310- $vacation.destination = Nil; #resets to default
311- say $vacation.destination; #OUTPUT Orlando
309+ say $vacation.destination; # OUTPUT: « San Francisco»
310+ $vacation.destination = Nil;
311+ say $vacation.destination; # OUTPUT: « Orlando»
312312
313313# Try to change a built private attribute later.
314314try { $vacation.status = 'Booked'; } #ERROR
You can’t perform that action at this time.
0 commit comments