Skip to content

Commit dfdd845

Browse files
committed
[io grant] Add "The Basics" section to TDIOG
(Links to currently non-existent IO::CatHandle, but it will exist soon)
1 parent d719a9f commit dfdd845

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

doc/Language/io-guide.pod6

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,31 @@
44
55
=SUBTITLE Correctly use Perl 6 IO
66
7+
=head1 The Basics
8+
9+
The vast majority of common IO work is done by the L<IO::Path> type. If you
10+
want to read from or write to a file in some form or shape, this is the class
11+
you want. It abstracts away the details of file handles (or "file descriptors")
12+
and so you mostly don't even have to think about them.
13+
14+
Behind the scenes, L<IO::Path> works with L<IO::Handle>; a class which you
15+
can use directly if you need a bit more control than what L<IO::Path>
16+
provides. When working with other processes, e.g. via L<Proc> or L<Proc::Async>
17+
types, you'll also be dealing with a I<subclass> of L<IO::Handle>: the
18+
L<IO::Pipe>.
19+
20+
Lastly, you have the L<IO::CatHandle>, as well as L<IO::Spec> and its
21+
subclasses, that you'll rarely, if ever, use directly. These classes give you
22+
advanced features, such as operating on multiple files as one handle, or
23+
low-level path manipulations.
24+
25+
Along with all these classes, Perl 6 provides several subroutines that provide
26+
let you indirectly work with these classes. These come in handy if you like
27+
functional programming style or in Perl 6 one liners.
28+
29+
While L<IO::Socket> and its subclasses also have to do with Input and Output,
30+
this guide does not cover them.
31+
732
=head1 The Wrong Way To Do Things
833
934
This section describes how NOT to do Perl 6 IO.

0 commit comments

Comments
 (0)