This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
new perldelta
[perl5.git] / ext / PerlIO-scalar / scalar.pm
CommitLineData
e934609f 1package PerlIO::scalar;
ec57fb93 2our $VERSION = '0.32';
f6c77cf1
NIS
31;
4__END__
b3d30bf7
NIS
5
6=head1 NAME
7
a920b0f7 8PerlIO::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
18or
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
28A filehandle is opened but the file operations are performed "in-memory"
29on a scalar variable. All the normal file operations can be performed
30on the handle. The scalar is considered a stream of bytes. Currently
846c5ed3 31fileno($fh) returns -1.
b3d30bf7 32
02e314e7
TC
33Attempting to open a read-only scalar for writing will fail, and if
34warnings are enabled, produce a warning.
35
a920b0f7 36=head1 IMPLEMENTATION NOTE
b3d30bf7 37
ec57fb93
LT
38C<PerlIO::scalar> only exists as a stub. One does not need to explicitly
39C<use PerlIO::scalar>.
b3d30bf7 40
a920b0f7 41=cut