Commit | Line | Data |
---|---|---|
e934609f | 1 | package PerlIO::scalar; |
ec57fb93 | 2 | our $VERSION = '0.32'; |
f6c77cf1 NIS |
3 | 1; |
4 | __END__ | |
b3d30bf7 NIS |
5 | |
6 | =head1 NAME | |
7 | ||
a920b0f7 | 8 | PerlIO::scalar - in-memory IO, scalar IO |
b3d30bf7 NIS |
9 | |
10 | =head1 SYNOPSIS | |
11 | ||
a920b0f7 JH |
12 | my $scalar = ''; |
13 | ... | |
14 | open my $fh, "<", \$scalar or die; | |
15 | open my $fh, ">", \$scalar or die; | |
16 | open my $fh, ">>", \$scalar or die; | |
8ec39683 RGS |
17 | |
18 | or | |
19 | ||
a920b0f7 JH |
20 | my $scalar = ''; |
21 | ... | |
22 | open my $fh, "<:scalar", \$scalar or die; | |
23 | open my $fh, ">:scalar", \$scalar or die; | |
24 | open my $fh, ">>:scalar", \$scalar or die; | |
b3d30bf7 NIS |
25 | |
26 | =head1 DESCRIPTION | |
27 | ||
a920b0f7 JH |
28 | A filehandle is opened but the file operations are performed "in-memory" |
29 | on a scalar variable. All the normal file operations can be performed | |
30 | on the handle. The scalar is considered a stream of bytes. Currently | |
846c5ed3 | 31 | fileno($fh) returns -1. |
b3d30bf7 | 32 | |
02e314e7 TC |
33 | Attempting to open a read-only scalar for writing will fail, and if |
34 | warnings are enabled, produce a warning. | |
35 | ||
a920b0f7 | 36 | =head1 IMPLEMENTATION NOTE |
b3d30bf7 | 37 | |
ec57fb93 LT |
38 | C<PerlIO::scalar> only exists as a stub. One does not need to explicitly |
39 | C<use PerlIO::scalar>. | |
b3d30bf7 | 40 | |
a920b0f7 | 41 | =cut |