Commit | Line | Data |
e934609f |
1 | package PerlIO::scalar; |
b162af07 |
2 | our $VERSION = '0.03'; |
f6c77cf1 |
3 | use XSLoader (); |
e934609f |
4 | XSLoader::load 'PerlIO::scalar'; |
f6c77cf1 |
5 | 1; |
6 | __END__ |
b3d30bf7 |
7 | |
8 | =head1 NAME |
9 | |
a920b0f7 |
10 | PerlIO::scalar - in-memory IO, scalar IO |
b3d30bf7 |
11 | |
12 | =head1 SYNOPSIS |
13 | |
a920b0f7 |
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 |
19 | |
20 | or |
21 | |
a920b0f7 |
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 |
27 | |
28 | =head1 DESCRIPTION |
29 | |
a920b0f7 |
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 |
33 | fileno($fh) returns C<undef>. |
b3d30bf7 |
34 | |
a920b0f7 |
35 | =head1 IMPLEMENTATION NOTE |
b3d30bf7 |
36 | |
a920b0f7 |
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 |