xref: /openbsd-src/gnu/usr.bin/perl/ext/PerlIO-scalar/scalar.pm (revision 1ad61ae0a79a724d2d3ec69e69c8e1d1ff6b53a0)
1package PerlIO::scalar;
2our $VERSION = '0.31';
3require XSLoader;
4XSLoader::load();
51;
6__END__
7
8=head1 NAME
9
10PerlIO::scalar - in-memory IO, scalar IO
11
12=head1 SYNOPSIS
13
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;
19
20or
21
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;
27
28=head1 DESCRIPTION
29
30A filehandle is opened but the file operations are performed "in-memory"
31on a scalar variable.  All the normal file operations can be performed
32on the handle. The scalar is considered a stream of bytes.  Currently
33fileno($fh) returns -1.
34
35Attempting to open a read-only scalar for writing will fail, and if
36warnings are enabled, produce a warning.
37
38=head1 IMPLEMENTATION NOTE
39
40C<PerlIO::scalar> only exists to use XSLoader to load C code that
41provides support for treating a scalar as an "in memory" file.
42One does not need to explicitly C<use PerlIO::scalar>.
43
44=cut
45