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