Skip to content

Commit f83f78c

Browse files
committed
[io grant] Use idiomatic Perl 6 in example
1 parent e60da5c commit f83f78c

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

doc/Type/IO.pod6

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -296,11 +296,8 @@ is C<False>, implying text semantics.
296296
297297
The encoding to use if opened in text mode.
298298
299-
# open explicitly as utf8
300-
my $fh = open("path-to-file", enc => "utf8");
301-
my $fh = open("path-to-file", enc => "utf-8"); # this form also works
302-
# open with latin1 encoding
303-
my $fh = open("path-to-file", enc => "latin1");
299+
my $fh1 = open 'path-to-file'; # default, utf-8
300+
my $fh2 = open 'path-to-file', :enc<latin-1>; # explicit, latin-1
304301
305302
Defaults to C<utf8>. The values are case-insensitive. The available encodings
306303
vary by implementation and backend. On Rakudo MoarVM the following are

0 commit comments

Comments
 (0)