Add =pod to be tidy.
[p5sagit/p5-mst-13.2.git] / lib / perlio.pm
CommitLineData
f3862f8b 1package perlio;
21;
3__END__
4
5=head1 NAME
6
7perlio - perl pragma to configure C level IO
8
9=head1 SYNOPSIS
10
11 Shell:
12 PERLIO=perlio perl ....
13
14 print "Have ",join(',',keys %perlio::layers),"\n";
15 print "Using ",join(',',@perlio::layers),"\n";
16
17
18=head1 DESCRIPTION
19
20Mainly a Place holder for now.
21
22The C<%perlio::layers> hash is a record of the available "layers" that may be pushed
23onto a C<PerlIO> stream.
24
25The C<@perlio::layers> array is the current set of layers that are used when
26a new C<PerlIO> stream is opened. The C code looks are the array each time
27a stream is opened so the "stack" can be manipulated by messing with the array :
28
29 pop(@perlio::layers);
30 push(@perlio::layers,$perlio::layers{'stdio'});
31
32The values if both the hash and the array are perl objects, of class C<perlio::Layer>
33which are created by the C code in C<perlio.c>. As yet there is nothing useful you
34can do with the objects at the perl level.
35
36There are three layers currently defined:
37
38=over 4
39
40=item unix
41
42Low level layer which calls C<read>, C<write> and C<lseek> etc.
43
44=item stdio
45
46Layer which calls C<fread>, C<fwrite> and C<fseek>/C<ftell> etc.
47Note that as this is "real" stdio it will ignore any layers beneath it and
48got straight to the operating system via the C library as usual.
49
50=item perlio
51
52This is a re-implementation of "stdio-like" buffering written as a PerlIO "layer".
53As such it will call whatever layer is below it for its operations.
54
55=back
56
57=head2 Defaults and how to override them
58
59If C<Configure> found out how to do "fast" IO using system's stdio, then
60the default layers are :
61
62 unix stdio
63
64Otherwise the default layers are
65
66 unix perlio
67
68(STDERR will have just unix in this case as that is optimal way to make it
69"unbuffered" - do not add a buffering layer!)
70
71The default may change once perlio has been better tested and tuned.
72
73The default can be overridden by setting the environment variable PERLIO
74to a space separated list of layers (unix is always pushed first).
75This can be used to see the effect of/bugs in the various layers e.g.
76
77 cd .../perl/t
78 PERLIO=stdio ./perl harness
79 PERLIO=perlio ./perl harness
80
81=head1 AUTHOR
82
83Nick Ing-Simmons E<lt>nick@ing-simmons.netE<gt>
84
85=cut
86
87